Archived topic
New line formatting in headline dynamic options
7 replies · Started by Jesse on September 14, 2021
Hi,
When using a Headline block to get an ACF Textarea or WYSIWYG field via dynamic options it strips the new line formatting so there are no hard returns or paragraphs.
I can add a <br /> to a textarea, but the WYSIWYG field removes them when switching back to the Visual tab.
Is there a filter to disable the automatic formatting happening on the Headline block?
Hi there,
The Headline block wasn't built with the purpose of outputting paragraphs of text.
This would be better in our Dynamic Content block, however it isn't currently possible to output custom post meta. I've logged an issue for this.
For now, you'll want to simply create a shortcode and use it in your template:
add_shortcode( 'my_meta_content', function() {
return get_post_meta( get_the_ID(), 'my_meta_key', true );
} );
Thanks Tom, this will work for now!
No problem!
Hi Tom,
How can I use your explanation in my website?
Thanks
Hi Ana,
Can you open a new topic and describe your issue?
Got the same issue with WYSIWYG and this solution isn't working for me.
I've made the shortcode and put it in the template and it still doesn't add paragraphs automatically.
However - if I switch from Visual to Text editor, and add <p> manually, then it works.
Is there any solution to this?
Hi Filip,
This is an old topic, can you open a new topic for your issue?