Different exceprt length for featured and normal posts in the grid

Community Forums Forums General Discussion Different exceprt length for featured and normal posts in the grid

This topic is: not resolved

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  nutsandbolts 10 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #68197

    danharding
    Member
    Post count: 7

    Hi,

    i saw this snippet for excerpt modification.

    http://my.studiopress.com/snippets/post-excerpts/#modify-length

    //* Modify the length of post excerpts
    add_filter( ‘excerpt_length’, ‘sp_excerpt_length’ );
    function sp_excerpt_length( $length ) {
    return 50; // pull first 50 words
    }

    But how do i change the length of featured blog posts only in the grid?

    Cheers
    Dan

    http://www.indulgemagazine.com.au
    #68335

    nutsandbolts
    Moderator
    Post count: 3129

    If you look at the home.php file for Modern Blogger Pro, you should see something similar to this (assuming the grid is part of the theme and you aren’t using the grid plugin):

    add_action( 'genesis_loop', 'nabm_grid_loop_helper' );
    function nabm_grid_loop_helper() {
    
    	if ( function_exists( 'genesis_grid_loop' ) ) {
    		genesis_grid_loop( array(
    			'features' 				=> 0,
    			'feature_image_size' 	=> 'featured',
    			'feature_image_class' 	=> 'post-image',
    			'feature_content_limit' => 0,
    			'grid_image_size'		=> 0,
    			'grid_image_class'		=> 'alignnone',
    			'grid_content_limit' 	=> 250,
    			'more'					=> __( 'Keep reading...', 'nabm' ),
    		) );
    	} else {
    		genesis_standard_loop();
    	}

    You can change the values for the feature content limit and grid content limit to whatever you want. You may also need to change your Genesis theme settings to show the content limit instead of excerpts. Hope that helps!


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

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

You must be logged in to reply to this topic.