Community Forums › Forums › General Discussion › Change home page grid layout.. Quattro Theme
This topic contains 5 replies, has 5 voices, and was last updated by SoZo 4 months, 2 weeks ago.
-
AuthorPosts
-
January 15, 2013 at 7:51 am #12032
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.
-
This topic was modified 5 months ago by
daveerin.
-
This topic was modified 5 months ago by
daveerin.
January 15, 2013 at 7:53 am #12033sorry..
url is nomadspirit.net if it helps any.
January 15, 2013 at 2:45 pm #12109What version of Genesis are you using?
January 15, 2013 at 3:24 pm #12114Please 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.
Jennifer “Hermione” Baumann | Recommended StudioPress Developer
Dream Whisper Designs | Themessence | @dreamwhisper | If I’ve helped, like me on FacebookFebruary 1, 2013 at 2:38 pm #17170I’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 #17178The 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
-
This topic was modified 5 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.