I want the following code to show the pagination if there are more than, or equal to, five wordpress posts on a page. I don’t know how to select the post. This is basically why I need to do this: For example, If I go to a category that has 6 posts, and click on the bottom navigation to go see the last post from that categoryâsince I only allow 5 posts per pageâthe nav works perfectly! BUT..if there is a category that only has 2 posts, and I allow 5, the styling for that nav still shows up. Is there an if/else statement that allows me to say, “if page displays < 5 posts, show this footer (without the posts_nav_link included) ?”
div class="wrapper">
<div class="pagination">
<?if(count($yourpostvariable)>=5){?>
<li id="left">
<?php posts_nav_link('','<span class="previous">→</span>','<span class="next">←</span>'); ?>
</li>
<?};?>
</div><!-- end .pagination -->
</div><!-- end .wrapper -->
1 comment