Next and Previous Links for Two Categories
-
Hi,
I’m probably missing something here, but I can’t get my post navigation to work right on a custom category page. I want an “archive” page to pull posts from two different categories.
I have that working using this code:
<?php $my_query = new WP_Query('cat=11,404'); while ($my_query->have_posts()) : $my_query->the_post(); ?>
The page displays posts from categories 11 and 404. At the bottom of the page I’d like to have simple text navigation links to display another set of ten posts from BOTH categories. I am using this code:
<?php previous_posts_link(__('« Newer Entries ', TRUE)) ?> <?php next_posts_link(__(' Older Entries »', TRUE)) ?>
When I test this and click on the Older Entries button it repeats the same list of posts–it doesn’t go on to list any other posts from categories 11 and 404.
Can anyone tell me if I’m missing something, or if this is just not possible. I’ve spent several hours trying to think of work arounds, and ways to fix this, but I can’t come up with anything.
Any thoughts would be greatly appreciated! I can provide more information if this is unclear.
Thanks!
- The topic ‘Next and Previous Links for Two Categories’ is closed to new replies.