• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Previous & Next Links not pointing to correct posts

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Previous & Next Links not pointing to correct posts

This topic is: resolved

Tagged: links, next, previous

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 9 months ago by wheelingit.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • May 1, 2015 at 4:39 pm #149759
    wheelingit
    Member

    Hi All,

    I have a perplexing little problem. I just added the following code to add "Previous" & "Next" links below each post:

    Adding Next & Previous Post Nav Links In Genesis


    function wpsites_npp_navigation_links() {
    /**
    * @author Brad Dalton
    * @example http://wpsites.net/
    * @copyright 2014 WP Sites
    */
    if ( is_singular('post') ) { ?>
    <span class="nav-previous alignleft"><?php previous_post_link('%link', 'Previous Post', TRUE) ?></span>
    <span class="nav-next alignright"><?php next_post_link('%link', 'Next Post', TRUE) ?></span>
    <?php
    } }
    add_action('genesis_entry_footer', 'wpsites_npp_navigation_links' );

    The Previous & Next links do show up on every page, BUT they're not pointing to the correct posts.
    Take the following example:

    THIS POST -> (http://www.wheelingit.us/2010/10/10/a-stroll-on-the-appalachian/),
    The Previous link SHOULD point to “NF Campground Rating – Rock Creek, Cherokee Forest (Erwin, TN)” (http://www.wheelingit.us/2010/10/08/nf-campground-rating-rock-creek-cherokee-forest-erwin-tn/)
    and the Next link SHOULD point to “Boosting Your Internet In the Boonies” (http://www.wheelingit.us/2010/10/13/boosting-your-internet-in-the-boonies/).

    HOWEVER
    The Previous link ACTUALLY points to (http://wheelingit.us/2010/10/05/geeks-in-the-forest-pondering-the-equations-of-life/) and the Next link ACTUALLY points to (http://wheelingit.us/2010/10/15/this-must-be-the-place/).

    Any idea why this is happening? Is there some code I've missed?

    http://wheelingit.us
    May 2, 2015 at 9:10 am #149823
    Brad Dalton
    Participant

    Genesis also includes a basic function which adds post navigation which you can use as another option. http://my.studiopress.com/snippets/entry-content#add-post-navigation

    The code you linked to can be modified to return posts from specific categories, exclude posts etc. It includes several parameters which can be modified as you can see on the Codex.


    Tutorials for StudioPress Themes.

    May 2, 2015 at 11:38 am #149841
    wheelingit
    Member

    AHA...the first code snippet worked! Don't know why the other one wasn't pointing correctly.
    Thank you. Nina

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Previous & Next Links not pointing to correct posts’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble