Community Forums › Forums › Archived Forums › Design Tips and Tricks › Limit featured posts in Generate theme
Tagged: featured post, generate theme, post loop
- This topic has 6 replies, 2 voices, and was last updated 10 years, 8 months ago by demetria.
-
AuthorPosts
-
February 8, 2014 at 3:00 am #89308demetriaMember
I would like to have only 2 featured posts on my home page (using the Generate theme), but I'm not sure how to declare this in the loop.
How do I make it so that featured posts are not continuously growing on my home page with each new post? (I've tried tinkering around with the settings in home.php, but to no avail.)
Any help would be appreciated.
http://www.websuccesscoaching.comFebruary 8, 2014 at 3:45 am #89313nutsandboltsMemberCan you paste in the contents of your home.php? You should be able to change the number of features within the grid loop, but I haven't looked at Generate in awhile.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 8, 2014 at 12:08 pm #89353demetriaMemberAbsolutely. Thank you for your help.
--------<?php
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'child_grid_loop_helper' );
//* Add support for Genesis Grid Loop
function child_grid_loop_helper() {if ( function_exists( 'genesis_grid_loop' ) ) {
remove_action( 'genesis_before_post_content', 'generate_post_image', 5 );
genesis_grid_loop( array(
'features' => 0,
'feature_image_size' => 'featured',
'feature_image_class' => 'alignleft post-image',
'feature_content_limit' => 50,
'grid_image_size' => 'grid',
'grid_image_class' => 'alignleft post-image',
'grid_content_limit' => 0,
'more' => __( 'Continue reading...', 'genesis' ),
) );
} else {
genesis_standard_loop();
}}
genesis();
February 8, 2014 at 12:10 pm #89354nutsandboltsMemberOkay, look in that second section, fourth line down where it says
‘features’ => 0,
- that should be changed from zero to 2. So however many posts you have set to show on a page, 2 should be features and the rest will be part of the grid. Let me know if that takes care of the issue for you!
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 9, 2014 at 10:54 pm #89594demetriaMemberThanks, Andrea- I see how to change the number of featured posts, but I would like to get rid of the grid layout. Is there a way for my featured posts to show up in a format with title, blog image, and a few lines of the post , several on the page- and get rid of the two-column grid?
February 9, 2014 at 10:57 pm #89595nutsandboltsMemberYes, you can do that! Sorry, I misunderstood. Just rename home.php in your theme's folder to something like home-old.php and it will display normal blog posts (configurable in Genesis > Theme Settings) instead of the grid. You may also need to change the number of posts per page in Settings > Reading to make it match whatever is in your Genesis settings.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+February 11, 2014 at 3:55 am #89756demetriaMemberWorked like a charm! Thank you sooo much. You were very helpful.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.