Next and Previous Permalinks Everywhere
I currently have a WP site which shows one post at a time. To go between the posts, I have “previous” and “next” links. Currently, the navigation code looks like so:
<li id="previousLink"><?php posts_nav_link('','','« previous') ?><?php previous_post('%','« previous', 'no'); ?></li>
<li id="permaLink"><a href="<?php the_permalink(); ?>">perma-link</a></li>
<li id="nextLink"><?php posts_nav_link('','next »','') ?><?php next_post('%','next »', 'no'); ?></li>
So, when the user goes to the front page and clicks “previous” etc, they get the link supplied by posts_nav_link() (which is a relative link). When they’re using the perma-linked page, they get the next_post() and previous_post() links (which are permalinks).
However, I’d like the next and previous post links to always be permalinks so that no matter which post someone is looking at, the address in the top is always a permalink to that post (except for the front page, of course). How might I achieve this? I’ve searched high and low here and in the codex and I still haven’t quite found out a way to force the “single page” behavior.
- The topic ‘Next and Previous Permalinks Everywhere’ is closed to new replies.