QUery Loop Post Meta = Body Content

For a query loop, instead of displaying Excerpt, is there a way to display all body content of a post type in a Headline block?

Hi @bowmah,

Set the dynamic source of the Headline Block to Excerpt, then add get-content to its class list.

Then add this PHP snippet:

add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
	if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'get-content' ) !== false ) {
		
		return get_the_content();
	}
	return $content;
}, 10, 3);
1 Like

Wow, that is brilliant. You are brilliant Fernando. Seriously awesome. Worked perfectly and gave a wonderful result to display a CPT with fully edited content (bold etc…).

2 GIANT thumbs up! Thank you.

You’re welcome @bowmah!

1 Like

As an aside, in WP Core they provide the Post Content Block.
You can add those inside a GB Query Loop.

1 Like

Hey great idea David. Let me test that out!