• 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

Home.php Not Working

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 › Home.php Not Working

This topic is: resolved
  • This topic has 5 replies, 3 voices, and was last updated 13 years ago by Jen Baumann.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • January 15, 2013 at 2:15 pm #12098
    Robin
    Participant

    The number of posts set in the home.php is not working.  It is showing the number of posts under "Settings > Reading > Blog pages show at most"

    Happening on several sites

    Easy Flavorful Recipes

    Home

    Started doing this after some updates - not sure if it was wordpress 3.5 or Genesis 1.9

    Thanks for any help.

    January 15, 2013 at 3:04 pm #12112
    varickdesign
    Participant

    This is an issue with the Grid Loop.

    Place the code below in your functions.php and remove the post_per_page state in your grid loop in your home.php

     

    add_action( 'pre_get_posts', 'wps_limit_loop_to_cat' );
    /**
    * Limit Grid Loop to a Specific Category on a Specific Page
    *
    * @author Bill Erickson
    * @author Travis Smith
    * @link http://www.billerickson.net/customize-the-wordpress-query/
    * @param object $query data
    *
    */
    function wps_limit_loop_to_cat( $query ) {
    // To Limit it on a page, change $post_id
    if( $query->is_main_query() && $query->is_home() ) {

    $query->set( 'posts_per_page', '7' );
    }
    }

    January 15, 2013 at 3:48 pm #12124
    Jen Baumann
    Participant

    See this: http://www.studiopress.community/topic/change-home-page-grid-layout-quattro-theme/#post-12114

    Note the code didn't post well so there's a note below the code block. Change the 2 to whatever number you need.

    January 15, 2013 at 4:58 pm #12147
    Robin
    Participant

    Added this to functions.php file

    add_action( 'pre_get_posts', 'child_change_home_query' );
    function child_change_home_query( && $query ) {
    if( $query->is_main_query() && $query->is_home() ) {
    $query->set( 'posts_per_page', '6' );
    }
    }

    and get this Error message

    Parse error: syntax error, unexpected ';' in /home/content/41/9844641/html/wp-content/themes/focus/functions.php on line 25

    January 15, 2013 at 5:00 pm #12148
    Robin
    Participant

    Figure out that I need to ad this

    add_action( 'pre_get_posts', 'child_change_home_query' );
    function child_change_home_query( $query ) {
    if( $query->is_main_query() && $query->is_home() ) {
    $query->set( 'posts_per_page', '6' );
    }
    }

    instead

    January 16, 2013 at 6:12 pm #12480
    Jen Baumann
    Participant

    Glad you got it sorted. 🙂

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Home.php Not Working’ 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