• 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 Buttons for Category

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 › Previous Next Buttons for Category

This topic is: not resolved

Tagged: Category; News Theme; Buttons;

  • This topic has 4 replies, 4 voices, and was last updated 11 years, 11 months ago by Susan.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • July 8, 2013 at 10:44 am #49809
    Susan
    Moderator

    I am working on a site for a client using the News theme. (www.demo.graphicallydesigning.com)

    For the Featured Tabbed Widget area, the client would like to have previous and next buttons leading from one post to the next in the same category, similar to those seen on this site:

    http://www.activebeat.com/diet-nutrition/20-foods-proven-to-boost-energy/2/

    Does anyone know of a plugin which would accomplish this, or can someone point me in the direction of a tutorial to accomplish this?

    Edited to add: I've seen the Genesis Post Navigation Plugin, but it doesn't seem to work correctly (nor can I see how to modify the text - default is the post name):

    http://wordpress.org/support/plugin/genesis-post-navigation

    Thanks!

    http://www.demo.graphicallydesigning.com
    July 8, 2013 at 11:08 am #49815
    Brad Dalton
    Participant

    If you only want the links to apply to posts in one category, you'll need to use a conditional tag.

    Here's 2 examples which you may need to tweak.

    Change the hook if needed.

    This uses HTML 5 hooks

    I think you could create those links manually using the next page tag

    http://codex.wordpress.org/Function_Reference/wp_link_pages


    Tutorials for StudioPress Themes.

    July 8, 2013 at 11:37 am #49817
    David Chu
    Participant

    Hi,
    A couple related thoughts. I just tried that Genesis plugin. I had to hack it to get it to activate in Genesis 2 beta. ๐Ÿ™‚ But no joy, it didn't display anything anyway. So it's a non-starter for Genesis 2, at least as it is now.

    I swapped back to Genesis 1.9, and it worked, and was, um, very springy upon mouseover. ๐Ÿ™‚ But it didn't give the center spot in your example telling where you were, so it's not really like your example page.

    You could certainly use Brad's approach. Another way would be to use Pagenavi, which I like, but it requires some mild template editing or use of hooks. The nice thing about this plugin is that it gives many display options that are not too "codey" to edit.

    Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

    July 8, 2013 at 3:26 pm #49857
    nickthegeek
    Member

    Susan,

    Just a note, Brad's code is pretty good, but it can be modified to show the link on all posts but only showing the previous/next link for posts in the same category. You can see the arguments in the codex
    http://codex.wordpress.org/Function_Reference/previous_post_link

    So you would end up with something like this

    add_action( 'genesis_after_post_content', 'my_post_nav', 5 );
    function my_post_nav() {
        if( ! is_single() )
            return;
    
        previous_post_link('<span class="single-post-nav previous-post-link">%link</span>', 'Previous in category', TRUE);
        next_post_link('<span class="single-post-nav next-post-link">%link</span>', 'Next in category', TRUE);
    }
    

    You can do a lot more with it than just that too. You can also do some cool stuff with images and add the post title and other HTML markup so that your links can have all kinds of cool styling.

    I've even done something custom with it on my blog to pull in a custom image size and use tags instead of categories. This took some pretty hackish custom code and it doesn't play nice if you aren't using categories the way I do to create series, but it works really well for my site.

    July 8, 2013 at 3:40 pm #49860
    Susan
    Moderator

    Thank you, gentlemen! I'll see how I go! ๐Ÿ™‚

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ 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