I have to get some custom post types and need to do that with WP_Query (query_posts doesn't work).
How can I do the pagination? Whatever I tried didn't work... any help would be awesome I can't crack this alone...
$args = array(
'tax_query' => array(
'posts_per_page' => 5,
array(
'author' => $user_id,
'taxonomy' => 'custom_taxtype',
'field' => 'slug',
'terms' => 'delicious-food',
)
)
);
$answer_query = new WP_Query( $args );
//// Loop trough the results
while ( $answer_query->have_posts() ) : $answer_query->the_post();
//// do something
endwhile;
paged => 1,2...nargument, and I think thatposts_per_page, as well aspagedshould be outside of thetax_queryarray. – soulseekah Oct 17 '11 at 10:56pagedand set it to the page number you are looking for? – soulseekah Oct 17 '11 at 11:30