• 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

Change home page grid layout.. Quattro 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 › General Discussion › Change home page grid layout.. Quattro Theme

This topic is: not resolved

Tagged: home page, Quattro

  • This topic has 5 replies, 5 voices, and was last updated 10 years, 8 months ago by SoZo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • January 15, 2013 at 7:51 am #12032
    ᴅᴀᴠɪᴅ
    Member

    I was just wanting to edit the home.php to make it so the posts would be in a grid view and there would be six visible posts. The home.php file seems fairly straight forward, even though I have never edited a php before, but there are not many lines of code in it.

    The code is just..

    <?php

    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'quattro_grid_loop_helper' );
    /** Add support for Genesis Grid Loop */
    function quattro_grid_loop_helper() {

    if ( function_exists( 'genesis_grid_loop' ) ) {
    genesis_grid_loop( array(
    'features' => 0,
    'feature_image_size' => 0,
    'feature_image_class' => 'alignleft post-image',
    'feature_content_limit' => 0,
    'grid_image_size' => 'grid-thumbnail',
    'grid_image_class' => 'alignnone',
    'grid_content_limit' => 200,
    'more' => __( '[Continue reading]', 'genesis' ),
    'posts_per_page' => 2,
    ) );
    } else {
    genesis_standard_loop();
    }

    }

    genesis();

    The problem is, I want only six posts to appear to the home page. No matter what figure I change the "'posts_per_page' =>" it remains as showing 10 posts. Anybody know what could be causing it?

    Also a second question.. how would i change the layout of the home page as it is not actually a page. It is stuck with two sidebars either side and i only wanted one sidebar. The options in genesis dont apply to the home page.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    January 15, 2013 at 7:53 am #12033
    ᴅᴀᴠɪᴅ
    Member

    sorry..

    url is nomadspirit.net if it helps any.


    I love helping creative entrepreneurs build epic things with WP & Genesis.

    Follow on Twitter

    January 15, 2013 at 2:45 pm #12109
    varickdesign
    Participant

    What version of Genesis are you using?

    January 15, 2013 at 3:24 pm #12114
    Jen Baumann
    Participant

    Please add this to your 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', '2' ); 
    	}
    }

    That should be && $query. The code isn't posting right.

    February 1, 2013 at 2:38 pm #17170
    ALotofLoves
    Member

    I'm having the same issue and when I try to enter the above code into functions.php I get an error. I don't understand the correction...can I have the correct code? I'd really like to fix this.

    Current installation here: http://cursivedesigns.com/cursivedesigns/

    February 1, 2013 at 2:45 pm #17178
    SoZo
    Member

    The board screwed up the code. Change the special characters to && . Otherwise the code is correct.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

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

© 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