SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to use different next and previous links

    I am trying to have different navigation links for full post when viewing from different sources.
    If I use the post title or more link from the blog page to see the full post, I want the navigation to go to the next or previous post on the blog page.
    If I view the full post from the categories page that list all post in a category, I want the navigation to go to the next or previous post in that category.
    As it is, when viewing the full post from either, it uses the single.php template.
    The navigation code on the single.php template is

    PHP Code:
    <div class="navigation">
    <div class="alignleft"><?php previous_post_link('%link''Previous Post 'true); ?></div>
    <div class="alignright"><?php next_post_link('%link''Next Post 'true); ?></div>
    </div>
    which will go to the next post in the category.
    If I use

    PHP Code:
    <div class="navigation">
    <div class="alignleft"><?php previous_post('%''Previous Post '); ?></div>
    <div class="alignright"><?php next_post('%''Next Post '); ?></div>
    </div>
    it goes to the next blog post.

    Is there a way to use both, dependant on where the full post is viewed from?

  2. #2
    SitePoint Member
    Join Date
    Mar 2013
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why not adding a plugin that have numbers?

  3. #3
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And what good would that do?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •