Community Forums › Forums › Archived Forums › General Discussion › Genesis loop plugin
Tagged: Genesis Grid Loop
- This topic has 4 replies, 3 voices, and was last updated 11 years, 5 months ago by Jose.
-
AuthorPosts
-
March 18, 2013 at 11:29 am #29048IH25Member
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 #29317Dorian SpeedMemberHi 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 #29786Dorian SpeedMemberThere'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 #29919IH25MemberI 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 #36949JoseMemberGreat! 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.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.