IF on latest post
-
Hi!
I have some blog pages and have Next/Previous links on the single.php page. To do this I am using the following code:
Previous Post:
<?php echo get_permalink(get_adjacent_post(false,'',false)); ?>
Next Post:
<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>
The problem however, if that even if I am on the latest or oldest post the Next/Previous button still shows.
Is there an IF statement I can use so for example the Next button does not show if I am on the very latest blog. Same goes for hiding the Previous button on the oldest post.
Thanks!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘IF on latest post’ is closed to new replies.