Custom Loop and Infinite Scroll

I used ‘init’ in the add_action in my own implementation of infinite scroll, try that.

add_action( 'init', 'vg_infinite_scroll_init' );

As to your question about rendering a custom query you would do the following.

-Set the render to your function name

'render' => 'your_render_function,

-Add your function to call a specified loop template

function your_render_function(){
  get_template_part( 'custom-loop-content' )
}

create a file called custom-loop-content.php and add your custom query in there. Be aware that your query will be reset each time. I couldn’t think of a way around that.

Leave a Comment