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!

Hello

I have tried creating a query loop and including the Post Content Block that David suggested to display the post content.

However with this method the layout made with GB inside the post content is lost.

Is there any plans to incorporate in GB a solution that allows us to display the entire content in the query loop while maintaining the layout made with GB?