Support

Account

Home Forums General Issues Text is displayed in one block

Solved

Text is displayed in one block

  • Hi,

    I have a custom field that I have created that is a Wysiwyg Editor field. When I enter several paragraphs of text within this field on the page I want this to be displayed it seems to ignore any HTML and just displays one block of text on the website front-end. The code I am using is shown below.

    Can anyone tell me why the HTML formatting isn’t showing please?

    <?php $content_middle = get_post_meta( get_the_ID(), 'content_middle', true); ?>
    `<?php echo $content_middle ?>

  • Because you are using get_post_meta() instead of get_field(). Formatting is only applied to ACF fields when you use get_field().

  • You can use this plugin https://wordpress.org/plugins/acf-views/ to easy display fields with a simple shortcode (like [acf_views view-id=”x”]), that can be pasted anywhere, including page editors.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.