• 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

Pagination, how to increase number of pages shown?

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 › Pagination, how to increase number of pages shown?

This topic is: not resolved

Tagged: pagination, pre_get_posts

  • This topic has 8 replies, 4 voices, and was last updated 6 years, 7 months ago by carasmo.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • June 14, 2016 at 10:49 am #187533
    chriswrites
    Member

    I have been trying to find the answer to this but haven't had any luck, if anyone can help it ould be much appreciated.
    On homepages / category pages / Archives Only a maximum number or paginated pages are shown i.e. 1 2 3 4 ... 32 Next page>

    I want to increase the number of pages shown ( I believe it helps search engine indexing.. reducing the amount of steps to each page) Whether you believe that or not does anyone have any ideas on how I could change it to show pages 1 - 10 instead of 1 - 4?

    Thanks!!

    http://chriswrites.com
    June 15, 2016 at 1:52 am #187569
    Brad Dalton
    Participant

    Try the Genesis > Theme Settings > Content Archive settings.


    Tutorials for StudioPress Themes & WooCommerce.

    June 15, 2016 at 2:03 am #187572
    chriswrites
    Member

    Thanks for trying to help but there are no options to this under the content archive settings.

    June 15, 2016 at 3:17 am #187575
    Brad Dalton
    Participant

    Try the WordPress Reading settings.


    Tutorials for StudioPress Themes & WooCommerce.

    June 15, 2016 at 3:20 am #187577
    chriswrites
    Member

    Yeah no its not there either, i was looking for info on a function, this definitely isn't part of the stock settings

    June 15, 2016 at 3:34 am #187578
    Brad Dalton
    Participant

    You can also try pre_get_posts


    Tutorials for StudioPress Themes & WooCommerce.

    October 19, 2016 at 3:54 pm #195068
    blacklion
    Member

    I'm looking for the answer to this, too. Anybody figure it out?

    October 19, 2016 at 7:46 pm #195079
    carasmo
    Participant

    You would unhook the genesis_posts_nav from the genesis_after_endwhile using remove action and hook in your own php, such as you could use https://codex.wordpress.org/Function_Reference/the_posts_pagination and notice the arguments, or you could copy out the genesis_numeric_posts_nav() into your child theme, rename the function, adjust the 2 to the left and 2 to the right if the page is + 2 (see genesis/lib/structure/post.php). I would go with the standard WordPress function, much easier to mess with. Using the instructions in the codex and removing the default, the result is:

    /**
     *
     * Archive Pagination with mid_size increase
     *   
     */
    function yourprefix_archive_pagination() {
    	
    	echo '<div class="archive-pagination pagination">';
    	global $wp_query;
    
    	$big = 999999999; // need an unlikely integer
    
    		echo paginate_links( array(
    			'base'      => str_replace( $big , '%#%', esc_url( get_pagenum_link( $big ) ) ),
    			'format'    => '?paged=%#%',
    			'mid_size'  => 5,
    			'current'   => max( 1, get_query_var( 'paged' ) ),
    			'total'     => $wp_query->max_num_pages
    		) );
    
    	echo '</div>';
    	
    }
    add_action( 'genesis_after_endwhile', 'yourprefix_archive_pagination' );
    
    //* remove default archive pagination
    remove_action( 'genesis_after_endwhile', 'genesis_posts_nav' );

    Genesis Theme Customization and Help

    October 19, 2016 at 7:49 pm #195080
    carasmo
    Participant

    I suggest, to save a lot of grief, use FTP and a code editor (not any wordprocessor) and add this the the very end of your functions.php file outside of all other functions or use the plugin My Custom Functions. Don't use the Appearance editor.


    Genesis Theme Customization and Help

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

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