- This topic has 5 replies, 4 voices, and was last updated 4 years, 6 months ago by
Elvin.
-
AuthorPosts
-
March 26, 2021 at 10:04 pm #1711487
Vijay
Hi Tom and Team,
Lovin the GP Theme Builder!
You made it so easy to use!
I notice its is so easy to display dynamic titles, categories, tags and event comment counts! Awesome!!!
How do I display the post excerpt? I tried, but can’t seem to find the right term or option

And can we similarly display page or custom post type excerpts?
March 27, 2021 at 3:30 am #1711711David
StaffCustomer SupportHi there,
there are 2 GP specific blocks added to the editor – you want the
Dynamic Contentblock it allows you to display the full Content or the Excerpt.The block also applies to and post type that supports the excerpt.
September 15, 2021 at 3:04 pm #1931949Brenden
The Dynamic Content block does work, but it is so limited compared to the GB Headline block. The Dynamic Content block does not have any styling/spacing options at all. It would be great if it was possible to pull in the post excerpt into the Headline block.
September 15, 2021 at 9:12 pm #1932106Elvin
StaffCustomer SupportHi Brenden,
You have a point.
But for now, if you want a workaround, we can make a dynamic headline block display excerpt.
Here’s what you can do:
– create a Headline block and add
dynamic-excerptto its HTML anchor field.
– set the Headline Block’s dynamic value to “post meta” and addthe_excerptto the meta field name.You then add this PHP snippet.
add_filter('generate_dynamic_element_text', function($custom_field, $block){ if($block['attrs']['anchor'] = 'dynamic-excerpt'){ if ( ! empty( $block['attrs']['gpDynamicTextCustomField'] ) && $block['attrs']['gpDynamicTextCustomField'] == 'the_excerpt' ){ if (has_excerpt()) { $excerpt = wp_strip_all_tags(get_the_excerpt()); $custom_field = $excerpt; } } return $custom_field; } },20, 2);But I think you can just wrap the dynamic content block w/ a container block and do your styling from there. 🙂 Headline blocks are meant for headings. 😀
September 16, 2021 at 6:30 am #1932512Brenden
Both of your solutions are super helpful. I like using a container block and add styling to that. Thank you!
September 16, 2021 at 7:57 pm #1933244Elvin
StaffCustomer SupportBoth of your solutions are super helpful. I like using a container block and add styling to that. Thank you!
Yeah that’s the most ideal way of doing it.
No problem. Glad to be of any help. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.