• mkallen

    (@mkallen)


    I have the following code on my index page:

    <div style=”text-align:center;”>
    <?php posts_nav_link(‘ · ‘, ‘previous page’, ‘next page’); ?>
    </div>

    Instead of paging through my posts, it keeps showing the same, most recent page. I have tried several variations of the above, to no avail. What am I doing wrong?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Chris_K

    (@handysolo)

    Are your permalinks, in general, working?
    Have a link to the blog?

    Thread Starter mkallen

    (@mkallen)

    Yes, my permalinks are working.

    Thread Starter mkallen

    (@mkallen)

    Here is a link to my blog:

    http://www.depts.ttu.edu/agriculturalsciences/news/

    Thanks.

    Chris_K

    (@handysolo)

    They work when paging through your categories. That’s good.

    Just not when paging through the “entire blog”. That’s… odd.

    Do you have category templates? If so, is the link on those using the same template tag as your theme’s index.php?

    Thread Starter mkallen

    (@mkallen)

    My category pages use an archive template with the following code:

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Previous Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Next Entries »’) ?></div>
    </div>

    I originally had this on the home page, but it wasn’t working.

    Chris_K

    (@handysolo)

    When you had it in the theme’s home page (index.php?) was it inside The Loop?

    Thread Starter mkallen

    (@mkallen)

    The navigation has never been in the loop.

    Chris_K

    (@handysolo)

    The doc on posts_nav_link() doesn’t seem to indicate that it needs to be in the loop:
    http://codex.ww.wp.xz.cn/Template_Tags/posts_nav_link

    However, the doc on next_posts_link and prev_posts_link appears to indicate they should be:
    http://codex.ww.wp.xz.cn/Template_Tags/next_post

    Thread Starter mkallen

    (@mkallen)

    Is next_posts the same as next_posts_link? next_posts goes in the loop on a single post page. posts_nav_link goes on the home page. I have

    <div style=”text-align:center;”>
    <?php posts_nav_link(‘ Β· ‘, ‘previous page’, ‘next page’); ?>
    </div>

    on my home page, but it doesn’t work either. In the address bar, it indicates that it is showing a previous page:

    http://www.depts.ttu.edu/agriculturalsciences/news/index.php?paged=2

    But the entries are always the most recent.

    Thread Starter mkallen

    (@mkallen)

    I used a different template (university mandated), but I tried to base it on the default template. When I changed to the default template, the next and previous page links worked! What could I have left out?

    Chris_K

    (@handysolo)

    πŸ™‚

    I’ve lost track of which tags are where and which don’t work!
    The next and prev post calls (2 seperate ones)? Perhaps you didn’t have ’em in The Loop?

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘posts_nav_link not working’ is closed to new replies.