prev/next Posts, else if prev is not available?
-
What I have:
<?php $prev_post = get_previous_post(); if($prev_post) { ?><div class='prev'><p><?php previous_post_link('%link') ?></p></div><?php }?> <?php $next_post = get_next_post(); if($next_post) { ?><div class='next'><p><?php next_post_link('%link') ?></p></div><?php }?>
I need previous post to be replaced by “HOME” if not available. For example, on the very first post, the previous link does not show because there are no previous articles, just the index page.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘prev/next Posts, else if prev is not available?’ is closed to new replies.