Support Forum
Support › Meta Box AIO › custom field WYSIWYG content not displaying with formatting
I've created a WYSIWYG custom field which I'm displaying on a page. It was working fine and the text was formatted as it had been entered in the field (with tags so that it displayed formatted on the frontend).
It now is just displaying all the text as one continuous block of text and doesnt seem to be adding any p tags to split the paragraphs.
the link to the page is here...
https://wordpress-232564-2098483.cloudwaysapps.com/test-page/
update - it seems to be only the p tags that arent being included. Other tags like the <h3> tag is fine.
Hi Jimimac,
Can you please share the code that creates the custom fields and steps to reproduce the issue?
I created the custom fields in wordpress using the plugin rathr than custom code.
here's the code Im using to display the field...
$section = rwmb_meta( 'section' );
$section_key = 0;
$text = $section[$section_key]['content_blurb'];
echo $text;
As I said the other things display fine but the p tags dont seem to be being created when the field is being edited.
I should add that the field is inside a group field
It might relate to this topic https://support.metabox.io/topic/lost-tag-in-wysiwyg-field-in-views/
Ok but I've now tried that and it's still not working.
It seems to be a problem with how the WYSIWYG field. Is there someone who could have a look?
Because that thread above doesnt seem to have a solution which is worrying.
Also the strange thing is that it WAS working fine originally and then all of a sudden the <p> tags disappeared.
Hi,
It looks like a WordPress issue. I also experience this and try to use the Classic Editor and see the <p>
tag also is not added. You can try to add the <p>
tag with a class in the tab Text to fix this issue.
<p class="custom-text">This is a paragraph 1</p>
<h3>This is a heading</h3>
<p class="custom-text">This is a paragraph 2</p>
I'm having the exact same problem. The WSYWYG editor removes <p> tags and thus makes itself impossible to use when trying to call the data dynamically to the site's front end. Did anyone find a fix for this?
Same here. Strange is that it was fine for first few posts, but then it stopped storing <p> tags on new posts. When i edit and resave first few posts it's ok on them, but not on new ones. wysiwyg inside cloneable group.
I have the same problem.
I'm having the same issue with WYSIWYG custom field and Regular Text Custom Field in Bricks Builder on the front-end the <p> tags are being removed when pulling data dynamically.
Is there a way to fix this?
I'm having exactly the same problem. I am using the WYSIWYG custom field and am outputting via a code block. Anyone find a solution?
yeah you need to wrap it in wpautop()