• 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 and Next Links

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 and Next Links

This topic is: not resolved

Tagged: pagination

  • This topic has 2 replies, 3 voices, and was last updated 7 years, 11 months ago by Victor Font.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 5, 2017 at 6:12 am #214274
    elan42
    Member

    Hello,
    I'm editing the template for a single custom post type, and trying to print the "previous" and "next" link within an Html structure, but the links get moved at the beginning of div.entry-content.

    Inspector analysis doesn't show any absolute positioning or other weird layout settings.

    This is the code:

    function displayCFS() {
    echo('
    ...
    // Pagination
    '<nav>'
    . previous_post_link() . '<span>Index</span>' . next_post_link() .
    '</nav>'
    ...
    );

    That "Index" word is correctly printed where it's supposed to be (after all the previous content), while the strings from previous_post_link() and next_post_link() are moved. I suppose it's a Genesis issue, as standard WordPress isn't supposed to behave this way?

    December 5, 2017 at 6:20 am #214276
    Brad Dalton
    Participant

    Try this code


    Tutorials for StudioPress Themes.

    December 5, 2017 at 6:25 am #214277
    Victor Font
    Moderator

    Position depends on the hook you linked into and the priority. There's not enough detail to say what's happening.

    The WordPress previous_post_link() and next_post_link() already echo the links, so by wrapping them in another echo, you're echoing an echo. This is the WordPress source for previous_post_link():

    function previous_post_link( $format = '&laquo; %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
        echo get_previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
    }

    Genesis also has its own functions for displaying links. Your code is working outside of the framework. So whatever is going on, it's going to take a deeper level of troubleshooting than can be provided with the details you've provided.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 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