WP_Query and Pagination?
-
Hi there,
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( array( 'author' => $user_id, 'taxonomy' => 'custom_taxtype', 'field' => 'slug', 'terms' => 'delicious-food', 'posts_per_page' => 5 ) ) ); $answer_query = new WP_Query( $args ); //// Loop trough the results while ( $answer_query->have_posts() ) : $answer_query->the_post(); //// do something endwhile;
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘WP_Query and Pagination?’ is closed to new replies.