WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] previous_post_link and previous_posts_link issue (2 posts)

  1. catalpha
    Member
    Posted 3 years ago #

    I would like to use the next_posts_link and previous_posts_link from the archive.php in the single.php, but if I cut and paste the links from archive.php and paste into index.php they don't work (there not clickable).

    From archive.php
    <?php next_posts_link('« Older Entries') ?> | <?php previous_posts_link('Newer Entries »') ?>

    From index.php
    <?php previous_post_link('« %link') ?> | <?php next_post_link('%link »') ?>

  2. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    On single.php (where only a single Post is displayed), you need to use previous_post_link() and next_post_link().

    Using previous_posts_link() and next_posts_link() on single.php will have no effect, because they are intended to be used on index pages, for navigating to previous and next index pages (index, archive, category, teg, etc.), rather than previous and next single posts.

Topic Closed

This topic has been closed to new replies.

About this Topic