Thank you, the same code works wonderfully as an ALM template.
I still have an issue because within Sage ALM fails to include its JS:
The alm_render_shortcode
function is being called before the wp_enqueue_scripts
, so the wp_enqueue_script('ajax-load-more')
comes before registering the script itself.
If I manually add
if (is_home() || is_category()) { // Enqueue core Ajax Load More JS wp_enqueue_script('ajax-load-more'); wp_enqueue_script('ajax-load-more-seo'); }
in my own enqueue function, ALM works again.
Any hint?
PS: I’m giving the same feedback to ALM author, too: https://wordpress.org/support/topic/no-posts-are-loaded/#post-9165527