Getting Pagination to work in custom query
-
I have tried a number of things, including shutting off all plugins, but I cannot get pagination to work.
<?php // WP_Query arguments $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array ( 'category' => '44', 'pagination' => true, 'posts_per_page' => '10', 'paged' => '$paged', ); // The Query $news_query = new WP_Query( $args ); // The Loop if ( $news_query->have_posts() ) { while ( $news_query->have_posts() ) : $news_query->the_post(); ?> <h2><?php the_title( ); ?></h2> <?php endwhile; ?> <?php next_posts_link('« Older Entries') ?> <?php previous_posts_link('Newer Entries »') ?> <?php } else { // no posts found } ?>
I read this forum post and the codex but no dice.
Thank you so much for any help.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Getting Pagination to work in custom query’ is closed to new replies.