• 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

Genesis next and previous page not post navigation

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 › Genesis next and previous page not post navigation

This topic is: resolved

Tagged: Genesis page navigation, page not post navigation

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 4 months ago by Susan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 27, 2015 at 2:23 am #142502
    octoberstone
    Participant

    Hi,
    I'm wondering if anyone can assist me with this function.

    The code below I've taken from: http://codex.wordpress.org/Next_and_Previous_Links and adjusted for use on my Genesis themed site.

    I've got it to display and work to a point at my test site:http://www.octoberstone.co.uk/wordpress/pay-your-rent/
    (See bottom of page, next and previous in red. The link in blue above it is put in manually to illustrate what the correct link should be).

    I don't seem to have the correct instruction on the links. The title being displayed is correct but the link is not. I think it is calling in the links according to the time and date of page publication rather than the numbered sort order.

    Ideally, I want the function to appear on parent pages and its children.
    I don't want it to appear on posts.

    I have search all over for a solution. I've tried a known plugin but its not suitable. I'm not a coder but not afraid to try. I'd really appreciate some pointers.

    Many thanks
    Tony

    //*
    add_action( 'genesis_entry_footer', 'is_subpage' );
    function is_subpage() {
    	$pagelist = get_pages('sort_column=menu_order&sort_order=asc');
    $pages = array();
    foreach ($pagelist as $page) {
       $pages[] += $page->ID;
    }
    
    $current = array_search(get_the_ID(), $pages);
    $prevID = $pages[$current-1];
    $nextID = $pages[$current+1];
    
    if (!empty($prevID))
    
    	echo '<nav class="page-footer-nav"><ul class="group">';
    previous_post_link( '&lt;li class="previous" title="Previous Post: ' . get_permalink($prevID) . '"&gt;%link', '&lt;span class="page-footer-label navlink-left"&gt;Previous&lt;/span&gt;&lt;span class="page-footer-title-previous"&gt;' . get_the_title($prevID) . '&lt;/span&gt;</li>' );
    
    if (!empty($prevID))
    
    next_post_link( '&lt;li class="next" title="Next Post: ' . get_permalink($nextID) . '"&gt;%link', '&lt;span class="page-footer-label navlink-right"&gt;Next&lt;/span&gt;&lt;span class="page-footer-title-next "&gt;' . get_the_title($nextID) . '&lt;/span&gt;</li>' );
    echo '</ul>&lt;/nav&gt;';
    }
    http://www.octoberstone.co.uk/wordpress/pay-your-rent/by-direct-debit/
    May 9, 2015 at 6:40 am #151214
    Susan
    Moderator

    As you posted this a while ago, I hope you were able to get your issue resolved. If it is resolved, please mark this thread as “resolved”, so it can be closed.

    If you are still having issues, report back here, and I will try to escalate.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 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