• 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

Adjust pagination Eleven40 theme

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 › Adjust pagination Eleven40 theme

This topic is: not resolved

Tagged: Eleven40, pagination

  • This topic has 4 replies, 2 voices, and was last updated 10 years, 6 months ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • November 4, 2014 at 7:20 am #130399
    winnydejong
    Member

    Hi,

    I use the Eleven40 theme on my blog: http://datajournalistiek.nl/. On the homepage you see 5 posts, while on all others you'll see 10. I've set the number of posts to show to 10 in the regular settings, and adjusted the number of posts on the homepage to 5 by adding the following code to functions.php:

    
    //* Show only 5 posts on frontpage
    add_action( 'pre_get_posts', 'change_num_posts_in_grid' );
    function change_num_posts_in_grid( $query ) {
    	global $wp_the_query;
    		if( $query->is_main_query() && is_home() && !is_paged() ) {
    			$query->set( 'posts_per_page', '5' );
    		}
    		
    }
    

    But I've found that the pagination doesn't change accordingly. At the homepage it looks like there are 29 pages. In reality there are only 15 pages, 'cause of all pages except the homepage showing 10 posts, not 5. How do I correct the pagination on the homepage?

    Thanks in advance. Best regards, Winny

    http://datajournalistiek.nl
    November 4, 2014 at 8:23 am #130407
    Brad Dalton
    Participant

    Link to the source of the code please.

    Did you modify the code in anyway like adding

    && !is_paged() ) {

    I’ve set the number of posts to show to 10 in the regular settings,

    The regular settings. Are you referring to the Reading Settings or the Genesis > Theme Settings?

    When you refer to home page, are you referring to the front page of your site or the blog page ( posts page )?


    Tutorials for StudioPress Themes.

    November 4, 2014 at 8:37 am #130409
    Brad Dalton
    Participant

    I tested the code and it controls the home page limit.

    All other archives are controlled by the Genesis > Theme Settings and the reading settings for the posts page.


    Tutorials for StudioPress Themes.

    November 4, 2014 at 4:27 pm #130486
    winnydejong
    Member

    Hi Brad,

    My Genesis > Theme settings are set to show 10 posts a page. The reading settings are also set to show 10 posts a page.

    The code I've added to the funtions.php only influences the front page, which now shows only the 5 latest post.

    The problem still remains: when you're on the homepage of datajournalistiek.nl, according to the pagination there are 29 pages. In reality there only 15 pages: on the frontpage the paginations divides the total number of posts by the number of posts you can actually see on the frontpage (5). In reality these 5 posts on the homepage are an exception, since all other pages show 10 posts.

    How do I set up the pagination accordingly?

    Thanks in advance.

    Best, Winny

    November 5, 2014 at 3:53 am #130565
    Brad Dalton
    Participant

    Link to the source of the code please.


    Tutorials for StudioPress Themes.

  • 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