PHP question

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.

3 Replies to “PHP question”

  1. At first go, I would try:
    < ?php } ?>
    <?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page »')); ?>
    <div class="sidebar">

    Hopefully that will render correctly.

  2. 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.

Comments are closed.