Home › Forums › Support › How to Make GenerateBlock Show Only Unique Excerpts This topic has 3 replies, 2 voices, and was last updated 3 years, 3 months ago by Fernando. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts January 22, 2023 at 12:12 pm #2505122 Andrey Hello! I am using DynamicContent to include post excerpt above my post meta. But I want this text to only show if a custom excerpt exists for the post. GenerateBlock seems to generate excerpt from the first words of the post. Is there a workaround? Thank you! Andrey January 22, 2023 at 8:17 pm #2505313 Fernando Customer Support Hi Andrey, Try adding check-custom-excerpt to the class list of the Headline Block. Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/ Then, add this snippet: add_filter( 'render_block', function( $block_content, $block ) { if ( !has_excerpt() && !is_admin() && ! empty( $block['attrs']['className'] ) && strpos( $block['attrs']['className'], 'check-custom-excerpt' ) !== false ) { return ''; } return $block_content; }, 10, 2 ); Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets January 23, 2023 at 3:09 am #2505574 Andrey Thank you so much, Fernando! This solution worked like a charm! January 23, 2023 at 5:00 pm #2506548 Fernando Customer Support You’re welcome, Andrey! Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In