In Wordpress, on the Single Post page, there is "Older Post" and "Newer Post" navigation links. It goes to the previous and next post. Is there a way to make sure those links skips over posts from a specific category?
@TheDoc, normally that would be the simple answer. But the Single Post page isn't a loop. And the "Older Post" and "Newer Post" are just straight Links. Here's the code to the page.
<?php /** * The Template for displaying all single posts. * * @package WordPress * @subpackage Twenty_Eleven * @since Twenty Eleven 1.0 */
The "get_template_part" line doesn't matter, it just fetches the Single Post html. What matters is that navigation that goes to the previous and next post. It takes all posts into account and I want it to ignore posts from a specific category
I tried putting it in and it started displaying the 5 most current posts that don't include that category. So I added "&showposts=1" to the remove category and so its just showing the most current post.
I did a bit of reading the WP Codex (not sure why I didn't before) and apparently both "previous_post_link()" and "next_post_link()" have an option inside to exclude categories and to even keep the links limited to 1 category.
Changing the number to the ID of the category you'd like to exclude.
The "get_template_part" line doesn't matter, it just fetches the Single Post html. What matters is that navigation that goes to the previous and next post. It takes all posts into account and I want it to ignore posts from a specific category
I did a bit of reading the WP Codex (not sure why I didn't before) and apparently both "previous_post_link()" and "next_post_link()" have an option inside to exclude categories and to even keep the links limited to 1 category.
Man, wordpress has a ton of options :)