• 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 modify numeric archive pagination?

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 › How to modify numeric archive pagination?

This topic is: not resolved

Tagged: content archives, numeric pagination

  • This topic has 10 replies, 3 voices, and was last updated 10 years, 9 months ago by exelexys.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • August 5, 2014 at 6:44 am #117150
    exelexys
    Member

    Would like to change the HTML tags of numeric pagination of content archives set in Genesis Theme Settings:

    Genesis Theme Settings / Content Archives

    What's the (best) way to modify the output of numeric pagination for content archives?

    Many thanks in advance!

    August 5, 2014 at 7:09 am #117152
    Brad Dalton
    Participant

    This might help otherwise you might need to dig into Genesis http://my.studiopress.com/snippets/post-navigation/#customize-newer-posts


    Tutorials for StudioPress Themes.

    August 5, 2014 at 8:50 am #117163
    exelexys
    Member

    Thanks for sharing. Is there a way to modify Genesis (like in this case) without modifying its core code?

    August 5, 2014 at 8:14 pm #117232
    Brad Dalton
    Participant

    Yes

    Using the filters included in the code which generates the pagination function in Genesis or any WordPress filters included in any functions Genesis uses for the pagination.

    You will be able to see all the WordPress/Genesis functions and filters in the Genesis code as well as in the code i linked to.

    I don't have the code for this solution at this point in time otherwise i would provide it.


    Tutorials for StudioPress Themes.

    August 5, 2014 at 8:49 pm #117242
    exelexys
    Member

    Thanks!

    Think this is it:

    August 5, 2014 at 9:19 pm #117247
    exelexys
    Member

    Add and style post pagination in Genesis Themes without a plugin

    August 5, 2014 at 10:17 pm #117263
    Brad Dalton
    Participant

    I don't think that applies to archive page links.

    I wrote about that last week and it applies to use of wp_link_pages for the more tag.

    There will be code in Genesis that does which i will post here when i find it.


    Tutorials for StudioPress Themes.

    August 5, 2014 at 11:35 pm #117288
    Brad Dalton
    Participant

    Here's the code

    https://gist.github.com/braddalton/ebb93a0dca0ebdc53212


    Tutorials for StudioPress Themes.

    August 6, 2014 at 1:25 am #117295
    emmtre
    Participant

    Any idea what to change if you only want one page before and after current page to save space on mobile devices? Is it ok to just remove the -2 and +2 links in the code or do i have to change some other parameters and code as well?

    //* Add the pages around the current page to the array
    if ( $paged >= 3 ) {
    	$links[] = $paged - 1;
    	$links[] = $paged - 2;
    }
    if ( ( $paged + 2 ) <= $max ) {
    	$links[] = $paged + 2;
    	$links[] = $paged + 1;
    }
    August 6, 2014 at 3:00 am #117302
    Brad Dalton
    Participant

    I wouldn't modify any of the code in Genesis however you can create a custom function with the code and use it in your child theme if you can't get the result you want using the filters.

    I don't have any code written and tested to do exactly what you want at this pint in time and it would take some playing around with to work out the best solution so i can only try and point you in the right direction at this stage.


    Tutorials for StudioPress Themes.

    August 8, 2014 at 4:14 pm #117823
    exelexys
    Member

    Thanks for taking the time to share the code. Much appreciated, as always.

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