Community Forums › Forums › Archived Forums › General Discussion › Grid Loop Plugin: Remove Post Title
- This topic has 5 replies, 3 voices, and was last updated 10 years, 2 months ago by
suburbanite.
-
AuthorPosts
-
November 6, 2014 at 1:46 pm #130721
suburbanite
MemberI am currently using Bill Erickson's Grid Loop Plugin for my portfolio pages. I have searched high and low to find the answer and nothing seems to be working, but I would simply like to remove the post title from the category archive (grid) page. I was able to use some code to get rid of the post excerpt, and I tried adding in code to that to get rid of the post title, but the title will not go away.
Any ideas? Basically, I just want the image thumbnail, not any extra text underneath.
Here's the code I have been using. Works great for everything except the post title:
http://www.angie-webb.com/** * 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; // Only display excerpt if not a teaser if( !in_array( 'teaser', get_post_class() ) ) echo '<p>' . wp_trim_words( get_the_excerpt(), $length ) . '</p>'; // Remove default content so we don't get both remove_action( 'genesis_post_title', 'genesis_do_post_title' ); remove_action( 'genesis_post_content', 'genesis_do_post_content' ); // For Genesis 1.x remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); // For Genesis 2.x } add_action( 'genesis_post_content', 'be_grid_content', 9 ); // For Genesis 1.x add_action( 'genesis_entry_content', 'be_grid_content', 9 ); // For Genesis 2.x
November 6, 2014 at 1:53 pm #130722Brad Dalton
ParticipantReplace this:
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
With this:
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
November 6, 2014 at 2:57 pm #130732suburbanite
MemberYay that worked! Except it didn't remove the post title on the first item. Any ideas?
November 7, 2014 at 3:58 am #130769Brad Dalton
ParticipantYou could have added a few lines of code to display your archives in a grid.
No need to install a plugin.
You'll need to ask the plugin author for support.
November 7, 2014 at 7:47 am #130780billerickson
MemberThe function you're making changes to is be_grid_content(), which displays the content of your grid posts.
The reason you are seeing the first post's title and not the rest is you've told Genesis to remove the post title but you did it from the content area, so the first post's title has already been output.
Remove the code you added to be_grid_content() : remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
Then add this: https://gist.github.com/billerickson/beb827a15c5407e62de2
November 7, 2014 at 7:52 am #130782suburbanite
MemberAh, perfect, that worked like a charm, thanks you Bill! I am new to all this, so I don't understand what all the PHP is actually doing, This helps a lot, thank you!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.