Turning second query into paged query?
-
I’m using this as my second query:
<?php $my_query2 = new WP_Query( array( 'post__not_in' => $saved_ids, 'post_type' => array( 'news', 'post' ), 'posts_per_page' => 10, 'tax_query' => array( array('taxonomy' => 'posttypes', 'terms' => 11, 'field' => 'id', 'operator' => 'NOT IN')))); ?> <?php while ($my_query2->have_posts()) : $my_query2->the_post(); if ($post->ID == $displayed) continue;?>I’m adding is_paged to my theme so my visitors can see all the post I’ve entered and it’s not displaying the next set of posts on the next page. I’ve found a solution (I think):
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=-27,-28&paged=$page&posts_per_page=5"); ?> <?php while (have_posts()) : the_post(); ?>What do I do now? I’m a little confused as to how to change the second query. Any help, either with code or a page to a solution, will be greatly appreciate.
Thanks,
Gregory S.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Turning second query into paged query?’ is closed to new replies.