thenew.oddend.com

WordPress previous and next post links all messed up

Update

I have added an All category and added each post not in the excluded category to this category. This temporarily fixes the problem with the navigation gaps.

Original Post

Something is very wrong with the WordPress template tags previous_posts_link and next_post_link. Theoretically passing the arguments $in_same_cat=false and $excluded_categories='5' would generate links that skip posts in category with id 5 and include posts from all other categories in the selection process.

As this site currently demonstrates, category 5 is indeed excluded. However, when a category 5 post would be the next or previous one, no link is displayed. A dead end. Unless…the post that follows is from the same category as the current post, then a link is displayed.

Digging around in the /wp-content/template-functions-links.php and hardcoding the queries still does not produce the right results. Or maybe I am just missing something. I am tired, I should go sleep. I hope the next update fixes this mess. Does trac require a login?

Leave a reaction

Keep it decent and to the point.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous article:
Attach hotkeys to links

Next article:
How advertising spoiled me

You can also head for the front page for more articles and notes.

You can use your browser's functions to scale this page up (ctrl +) or down (ctrl -).

Leaving already? Take the RSS snacks.