Genesis loop plugin

Community Forums Forums General Discussion Genesis loop plugin

This topic is: not resolved

This topic contains 4 replies, has 3 voices, and was last updated by  Jose 1 year, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29048

    IH25
    Participant
    Post count: 1

    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

    #29317

    Dorian Speed
    Participant
    Post count: 140

    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!

    #29786

    Dorian Speed
    Participant
    Post count: 140

    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.

    [php]
    /**
    * 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 );
    [/php]

    If you’re using three columns instead of two, you presumably need to change this line:
    [php]
    if( in_array( ‘one-half teaser’, get_post_class() ) ) {
    [/php]

    to this:
    [php]
    if( in_array( ‘one-third teaser’, get_post_class() ) ) {
    [/php]


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

    #29919

    IH25
    Participant
    Post count: 1

    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.

    #36949

    Jose
    Participant
    Post count: 12

    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.

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

You must be logged in to reply to this topic.