I’m stumped. I want to put "next page" and "previous page" links at the foot of each page. I know I should be using posts_nav_link
. Where should I put it? My current code looks like this:
[the main body of the grayblog page]
</div>
< ?php } } else { // end foreach, end if any posts ?>
Sorry, no posts matched your criteria.
< ?php } ?>
<div class="sidebar">
[the sidebar part of the page]
Help?
Incidentally, I’ve turned off the anti-spam plugin that I was using because it was generating false positives. Fingers crossed.
At first go, I would try:
< ?php } ?>
<?php posts_nav_link(' — ', __('« Previous Page'), __('Next Page »')); ?>
<div class="sidebar">
Hopefully that will render correctly.
Nearly… the proper code is at the bottom of the index.php file for the ‘classic’ theme anyway.
I might have to cut and paste from the classic theme. I tried that which you suggest there, and it inserted the links after each iteration of the loop, which is clearly wrong. Looks like a project for one evening next week.