• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Genesis loop plugin

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Genesis loop plugin

This topic is: not resolved

Tagged: Genesis Grid Loop

  • This topic has 4 replies, 3 voices, and was last updated 9 years, 11 months ago by Jose.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • March 18, 2013 at 11:29 am #29048
    IH25
    Member

    Hello

    I have installed and successfully used the Genesis Grid Loop Plugin at http://gentlemovement.co.uk/blog

    It is set to 1 featured and 3 teasers . My question is how can I set the featured word length and teaser word length to be different. Also is it possible to pass on the styling from the main post to the blog page and finally is it possible to set the articles in the blog to justified?

    Many thanks

    March 19, 2013 at 12:44 am #29317
    Dorian Speed
    Member

    Hi there - I've actually been figuring out this same thing, with quite a lot of help from Bill Erickson and Brandon Kraft. With regard to the excerpts being different lengths for features vs. teasers, that is. I've got it almost sorted out thanks to them, and I'll be posting about it in the comments on Bill's lengthy discussion of the grid loop. I'll come back and put the solution here, as well.

    With regard to the styling and the articles being justified, I think it would be best for you to open up separate questions for those issues, since these are three different questions.


    Bringing websites Up to Speed
    Firebug will light the way to understanding the secrets of the Internet!

    March 20, 2013 at 2:16 pm #29786
    Dorian Speed
    Member

    There's a lengthy discussion on Bill's site about how to customize the grid loop - I encourage you to check it out.

    Here's the code that's working for me re: customize length of excerpts. It may be that Bill further modifies this because I'm not sure I've got it quite right, so I would encourage you to follow along with that discussion on his blog.

    /**
     * Grid Content
     * Change the number of words in excerpt if in the grid loop
     */
    function be_grid_content() {
     
    	// First, we make sure we're in the grid loop.
    	if( ! apply_filters( 'is_genesis_grid_loop', false ) )
    		return;
     
    	// Change length if teaser
    	if( in_array( 'one-half teaser', get_post_class() ) ) {
    		$length = 60;
    		}
    	else {
    		$length = 400;
    		 //print_r(get_post_class());
    }
     
    	echo '<p>' . wp_trim_words( get_the_content() , $length ) . '</p>';
    	// Remove default content so we don't get both
    	 remove_action( 'genesis_post_content', 'genesis_do_post_content' );
    }
    
    add_action( 'genesis_post_content', 'be_grid_content', 9 );
    

    If you're using three columns instead of two, you presumably need to change this line:

    	if( in_array( 'one-half teaser', get_post_class() ) ) {
    

    to this:

    	if( in_array( 'one-third teaser', get_post_class() ) ) {
    

    Bringing websites Up to Speed
    Firebug will light the way to understanding the secrets of the Internet!

    March 21, 2013 at 6:52 am #29919
    IH25
    Member

    I had in fact started to peruse Bill's site. I also tried the code you supplied but not successfully yet. Many thanks for this.

    April 22, 2013 at 2:09 pm #36949
    Jose
    Member

    Great! Now if someone can only tell me how to get rid of the eilipsis... so I can show only the thumbnails in the blog page.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble