Archived topic
How to replace main content using element block ?
9 replies · Started by bruno on April 12, 2023
Hi
I created a custom post type for which I want the main content to have a specific design and text placement (ACF).
I created a block element, but I don't see any option to replace main_content with it ?
Thanks
Hi there,
use a Block Element, with the Display Rules set to your single post and set the element type to Content Template:
https://docs.generatepress.com/article/block-element-content-template/
That works perfectly thanks !
Is there a way to integrate custom fields in the loop query ?
GB's blocks have the dynamic data option:https://docs.generateblocks.com/article/dynamic-data-options-overview/
@Ying, I found that section, but there's no ACF or similar in it. I want to show only elements with a specific custom field value from a CPT.
ACF or other same kinds of plugins create custom fields for certain post types, and store data as the post meta.
You can set the source content to post meta, then enter the ACF field name.
I'm sorry, I don't see that option, can you make a screenshot please ?
Hi Bruno,
This section in the article has a screenshot: https://docs.generateblocks.com/article/dynamic-data-options-overview/#content-post-meta
Thank you Fernando
You're welcome, Bruno!