Community Forums › Forums › Archived Forums › General Discussion › Change home page grid layout.. Quattro Theme
- This topic has 5 replies, 5 voices, and was last updated 12 years, 11 months ago by
SoZo.
-
AuthorPosts
-
January 15, 2013 at 7:51 am #12032
ᴅᴀᴠɪᴅ
MemberI 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.
January 15, 2013 at 7:53 am #12033ᴅᴀᴠɪᴅ
Membersorry..
url is nomadspirit.net if it helps any.
I love helping creative entrepreneurs build epic things with WP & Genesis.
January 15, 2013 at 2:45 pm #12109varickdesign
ParticipantWhat version of Genesis are you using?
January 15, 2013 at 3:24 pm #12114Jen Baumann
ParticipantPlease 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 #17170ALotofLoves
MemberI'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 #17178SoZo
MemberThe 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
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.