• 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

How to add numeric archive pagination to single post pages

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 › Design Tips and Tricks › How to add numeric archive pagination to single post pages

This topic is: resolved

Tagged: archive pagination, links, navigation, single page

  • This topic has 13 replies, 2 voices, and was last updated 10 years, 9 months ago by Carla the Moose.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • July 6, 2015 at 2:17 pm #158545
    Carla the Moose
    Member

    Hi there,

    My site is not live yet, but I am using the most recent version of Genesis and WordPress and am hoping you can still help me. The child theme I am using is a basic one I created based on Genesis.

    On my homepage I was able to easily set up numeric pagination at the bottom of the page. I only display one post on each page, and it lets users navigate smoothly. This is not plugin.

    When I click on a blog post title, it takes me to the single post page for that title. There isn't any navigation. I would like to use the exact same navigation for these single post pages, but I'm not sure how.

    I thought this would be a simple matter of adding is_single to the functions code for the archive pagination, but I'm not sure what to use. Can you please help with this?

    Thank you.

    July 6, 2015 at 2:18 pm #158547
    Carla the Moose
    Member

    I should add, I do not want to use a plugin for this.

    July 6, 2015 at 3:12 pm #158552
    pxforti
    Participant

    The numeric nav doesn't make sense for single posts. You'd want to use Previous / Next for previous next post.

    For formatting of previous next, see this page: https://codex.wordpress.org/Next_and_Previous_Links

    To add previous next to single posts, add the following code to the end of your functions.php file:

    add_action( 'genesis_after_comments', 'genesis_prev_next_post_nav', 2 );

    Note: to change the location of the prev/next links, change the action hook; eg, code above adds to genesis_after_comments.
    See the following url for other genesis hooks: http://my.studiopress.com/docs/hook-reference/


    writeNowDesign
    WordPress and Ecommerce Website Design

    July 6, 2015 at 3:47 pm #158554
    Carla the Moose
    Member

    Thank you.

    Since I only have one post on each page, including the homepage of my website, does it make sense to only use single post archive pages for my entire website? It seems silly that people have to click through to the single post page to get the permalink if needed.

    So the homepage would be the most recent single post entry.

    Is there any reason I should keep it as it is, a standard blog with permalink post titles that take readers to the single post page?

    I've often wondered about this.

    July 6, 2015 at 6:20 pm #158591
    pxforti
    Participant

    Why do you show only one post on the blog page? You're right, the user has to do a lot of clicking to see what's there. Seems like it would be more user friendly to show 5 or 10 posts per page with the numeric paging system and then maybe use the previous /next code for single posts.


    writeNowDesign
    WordPress and Ecommerce Website Design

    September 21, 2015 at 4:27 pm #166261
    Carla the Moose
    Member

    It's been a few months since I asked this question.

    I'm now ready to finish my website and launch it tomorrow. I add the code snippet to my functions file and changed the hook to genesis_entry_footer. Even without the changed hook, my single post pages are not showing the previous/next pagination links.

    Any suggestions on what to do? I've been researching this all day. It seems like a simple task, but for some reason I can't find any help.

    My website is not live. I'm running the most recent version of Genesis with my own theme.

    Thank you!!

    September 21, 2015 at 4:31 pm #166264
    Carla the Moose
    Member

    I believe the WordPress codex is saying the previous/next code was created for non-permalink navigation.

    The code snippet you gave me doesn't say to put it on the permalink pages. This is my last task before launching tomorrow, so I'll play around and learn as much as I can.

    Please let me know if you can help me understand how this works better. Thank you!

    ETA: I'm learning! I'm learning! I'm making sense of the codex you linked to earlier. So let's see what needs to be done to make this display on my permalink pages. :o)))

    September 21, 2015 at 4:38 pm #166266
    Carla the Moose
    Member

    Ack!

    So I managed to make sense of the codex for this, only to scroll down a bit further and see 'Deprecated' in a red box surrounding this: previous_post_link() and next_post_link()

    The snippet you gave me is just for Genesis, but it's not working. And the WordPress solution isn't an option anymore.

    This is one of those situations where I needed to ask the right question to find my answer, but I'm not sure what to ask!

    :o)))

    September 21, 2015 at 7:20 pm #166279
    pxforti
    Participant

    Try this:

    function wnd_navigation_links() { ?>
    <div class="adjacent-entry-pagination pagination"><div class="pagination-previous alignleft"><?php
    	previous_post('&laquo; %', 'Previous', 'no');?>
    	</div><div class="pagination-next alignright"><?php
    	next_post('% &raquo; ', 'Next', 'no'); ?>
    	</div></div> <?php 
    }
    
    add_action('genesis_entry_footer', 'wnd_navigation_links', 5 );

    writeNowDesign
    WordPress and Ecommerce Website Design

    September 21, 2015 at 8:02 pm #166282
    Carla the Moose
    Member

    Well, just like that it works!!

    Thank you SO much. Maybe folks don't feel permalink pages should have navigation links. I don't think any of the StudioPress themes include them.

    This is just me being a lone ranger, I guess. But when I land on a single post page, I tend to feel stuck if I don't have a way to navigate to more content. It seems like a missed opportunity to put more material in front of people.

    I'm so very grateful to you. :o)))

    September 21, 2015 at 8:03 pm #166284
    pxforti
    Participant

    You're welcome. And I agree with you; I link to have a previous / next link on the pages. I think that might encourage people to read more posts.


    writeNowDesign
    WordPress and Ecommerce Website Design

    September 21, 2015 at 8:14 pm #166289
    Carla the Moose
    Member

    I just need to limit it so it doesn't display on the main blog homepage, since the links are for permalink navigation.

    And 'is single' something or other statement should do that for me.

    :o)))

    September 21, 2015 at 8:18 pm #166290
    pxforti
    Participant

    try this:

    function wnd_navigation_links() {
    if (!is_single())
    return; ?>
    <div class="adjacent-entry-pagination pagination"><div class="pagination-previous alignleft"><?php
    previous_post('« %', 'Previous', 'no');?>
    </div><div class="pagination-next alignright"><?php
    next_post('% » ', 'Next', 'no'); ?>
    </div></div> <?php
    }

    add_action('genesis_entry_footer', 'wnd_navigation_links', 5 );


    writeNowDesign
    WordPress and Ecommerce Website Design

    September 22, 2015 at 1:35 am #166301
    Carla the Moose
    Member

    Here's how I was able to get it to work. Thanks so much for your help. This has puzzled me for a good long while.

    add_action('genesis_after_endwhile', 'wnd_navigation_links', 5 );
    function wnd_navigation_links() { 
      if ( !is_home() || is_single() ) { 
    ?>
    <div class="adjacent-entry-pagination pagination"><div class="pagination-previous alignleft"><?php
    	
    	previous_post('&laquo; %', 'Older', 'no');?>
    	</div><div class="pagination-next alignright"><?php
    	next_post('% &raquo; ', 'Newer', 'no'); ?>
    	</div></div> <?php 
    }}
  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘How to add numeric archive pagination to single post pages’ 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