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.
Related Posts:
- Add Infinite Scroll to Ajax Loaded Category Query
- Enable infinite scroll on single.php [closed]
- Infinite Scroll and DFP
- Infinite Scroll on a loop?
- Pagination on Single Post
- Solved – Inserting content inside the WordPress loop
- Featured posts and the loop
- Get date of last update outside of loop
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- wp-admin redirecting to https, denying login
- wordpress loop for specific category
- Pagination/infinite scroll with WP_Query and multiple loops
- Add Incrementing ID to each paragraph in the_content
- Multiple posts with one loop iteration
- Query date in wordpress loop
- Transient not working for custom loops
- Custom Loop, Match Category with Page
- Ajax Infinite Scroll In Custom WP_Query Loop Not Working
- Display page of custom posts?
- get_the_content not working in loop?
- Get link of inserted media file of post within loop
- If No Search Results, Show Posts from Alternate Search Query
- Jetpack Infinite scroll conflicting with theme’s pre_get_posts custom posts_per_page
- Output shows a page instead of a list of blog postings
- How to add “time” data this?
- multiple loops with pagination on the same page
- Custom search form to display users only
- Multiple loops on the same page removing post tags
- Pages inside a page (with thumbnails)
- How to make post content from each post display within the same div
- Displaying the last page of posts
- How to order posts by meta_value created inside loop?
- How to get_posts where ‘menu_order’ is more than 0/zero?
- WordPress Redirects on Install
- How to load all pages into one page with their templates
- Problems with loop
- Repeating Loop on my Posts Page
- Shortcode with a foreach and arguments
- Calling & display certain product category loop and pagination on the homepage
- Detect if current page is front page within custom query
- Display Authors in a grid loop
- Blog’s post count cause irratic behavior
- show random image in loop if image is not set
- Get Page content to displayin Bootstrap Modal
- Pagination – works on local but not live dev!
- Combine the results of two loops [closed]
- How to show more random posts if Tag has less than 3 posts
- How to display pending posts on the homepage only for editors
- How can I improve the performance of this query_posts loop?
- Add leading zero to current post display [closed]
- Distribute Gallery Images Every nth in Loop
- WordPress Image Slider Looping Title Not Working
- Is there any good reason for two CSS files to @import each other?
- Adding div after every two post on main loop! Why will first post not get counted?
- Second Loop Showing Only One Post on Single Post Page
- Pulling in featured image into default recent posts widget
- Jetpack Infinite Scroll – changing number of posts
- Random post link generator messes up the loop
- how can i order the category by date
- Change position of entry title
- excerpt not showing up
- Announces with different formatting dependently on a number
- Override orderby to create list of users by custom meta_value
- Loop info in jquery Tabs – loop into a variable?
- Thumbnail Image Rounded Corners w CSS (or any other good method)
- Several loops in sidebar issues
- List page is showing 404
- Duplicated tag in loop
- Insert content above an embedded video inside Wordress’ php the_content
- Loop only shows first two posts
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Use ACF Category Image for all Taxonomy Archive Views
- Loop with custom posts, to include information from different custom post type
- the loop printing post in one grid
- Transient not working for external data
- adding tax_query to $query_string
- Remove posts_orderby filter then add it back in
- the_title() Returns the page title instead of the post
- WP update_post_meta link loop
- How do I aproach this?(for sale, for lease, sold->move something from a category to another)
- How to fix pagination for custom loops?
- query_posts ignores the argument
- Conditional Check in The Loop’s Parameters
- How does the JSON API work to parse incoming JSON and fetch a post based on an ID?
- How to add excerpt in loop in Twenty Eleven theme?
- show posts from one category with comments only
- Loop from another WP site onto mine
- Having issue with WordPress loop
- How to implement template file and the loop
- Show only posts from todays date [duplicate]
- I need to update the post query? [closed]
- Wrap every 2 divs in row – for each loop [closed]
- How to add class to the last image of the last post in a loop
- Multiple loop with pagination in same page
- Why did my most recent article fall behind an older one on my site?
- wp_mail sending only once inside foreach loop
- How to use orderby on meta_value when using Pods custom database table storage
- wp_mail function not working in user query loop
- How to set and retrieve cookies while in the loop