Limit featured posts in Generate theme

Community Forums Forums Design Tips and Tricks Limit featured posts in Generate theme

This topic is: resolved

This topic contains 6 replies, has 2 voices, and was last updated by  demetria 7 months, 1 week ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #89308

    demetria
    Participant
    Post count: 10

    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.

    • This topic was modified 7 months, 2 weeks ago by  demetria.
    • This topic was modified 7 months, 2 weeks ago by  demetria.
    http://www.websuccesscoaching.com
    #89313

    nutsandbolts
    Moderator
    Post count: 3131

    Can 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #89353

    demetria
    Participant
    Post count: 10

    Absolutely. 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();

    #89354

    nutsandbolts
    Moderator
    Post count: 3131

    Okay, 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #89594

    demetria
    Participant
    Post count: 10

    Thanks, 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?

    #89595

    nutsandbolts
    Moderator
    Post count: 3131

    Yes, 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, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #89756

    demetria
    Participant
    Post count: 10

    Worked like a charm! Thank you sooo much. You were very helpful.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.