next_post_link not interpreting all the passed parameters?
-
My entire site is hosted in WP. The main page is at http://www.portigal.com and the blog is at http://www.portigal.com/blog.
Posts in the News category are displayed on the main page, and posts in the Blog category are on the /blog page.
I recently learned about previous_post_link and next_post_link and got ’em working fine.
<div id="nav-below" class="navigation"> <div class="nav-previous"> <?php previous_post_link(__('« %link')) ?></div> <div class="nav-next"><?php next_post_link(__('%link »')) ?></div></div>
But then I posted to the News category and realized that the links – on the main blog – were going to mess up since they went to posts that are NOT previous or next on that page. But they are different categories, so I edited the code
<div id="nav-below" class="navigation"> <div class="nav-previous"> <?php previous_post_link(__('« %link', TRUE)) ?></div> <div class="nav-next"><?php next_post_link(__('%link »', TRUE)) ?></div></div>
But nothing changed; single posts in the Blog category still showed a previous link to a post in the News category.
I added the code to exclude the News category (redundant, but what the heck)
<div id="nav-below" class="navigation"> <div class="nav-previous"> <?php previous_post_link(__('« %link', TRUE, '2')) ?></div> <div class="nav-next"><?php next_post_link(__('%link »', TRUE, '2')) ?></div></div>
Also didn’t have any effect. All three versions of code produce the same result.
I’m sure I’m missing something (and I’m sure I failed to provide some info here) – your help appreciated!
- The topic ‘next_post_link not interpreting all the passed parameters?’ is closed to new replies.