I have a page that uses three queries to retrieve a variety of content. One of those queries grabs posts that are related to the topic of the page. Since these posts can be of all sorts and related through a variety of methods (various magic fields defined values, their category, etc.) I am using a custom query to grab them (something where I build some args and pass them to WP_Query() like so: $collected_child_posts = new WP_Query($args);
Currently I return 5 results at a time (in my args I have 'posts_per_page' => 5
) and I want to page those results using ajax so that only that block of results updates when you click a MORE POSTS
link.
I implemented this by adding a url to the MORE POSTS
button that looks like ?paged=n
and then having that retrieved via ajax. Problem is I get the entire page back (including the desired posts) when I only want the posts themselves.
Any ideas on the best way to retrieve just those posts from the subquery without returning the entire page?
Thanks!