Hi there!
I have created a custom field with a WYSIWYG editor for a particular page that I also want to see in a different page. When I get_field() it in the post it was created the output is perfect, but when I try to pull it in from a different post the output has not a single <p>, which completely messes up my styles.
Here’s what it looks like from the post it was generated:
$field_dump = get_field('featured_show_content');
var_dump($field_dump);
produces the following output
string '<h1>heading 1</h1>
<h2>heading 2</h2>
<h3>heading 3</h3>
<h4>heading 4</h4>
<pre>preformatted</pre>
<p>This is the first paragraph of this wysiwyg test.</p>
<p>This is the second paragraph of the wysiwyg test.</p>
And when in a different post:
$custom = get_post_custom(33);
var_dump($custom);
produces the following output
'featured_show_content' =>
array (size=1)
0 => string '<h1>heading 1</h1>
<h2>heading 2</h2>
<h3>heading 3</h3>
<h4>heading 4</h4>
<pre>preformatted</pre>
This is the first paragraph of this wysiwyg test.
This is the second paragraph of the wysiwyg test.
As you can see, there aren’t <p>s on the second case. Why does this happen? Is there a way around it? Any help would be much appreciated.
Thanks!