Home Forums Front-end Issues html code into textarea


html code into textarea

  • Hi,

    I’m using a textarea field to store a youtube embed code, like this:

    <iframe width="1280" height="720" src="//" frameborder="0" allowfullscreen></iframe>

    in front end I’m using the following code:

    $video = get_field('textarea');
    echo $video;

    But it will display the string as plain text, not as html code.
    How can I echo this field so that I can show the video in front-end?

    Thank you very much in advance.

  • Hi @virgodesign

    Please edit your textarea field settings, and change ‘Formatting’ to ‘Convert HTML into tags’.


  • Very strange, now it works.
    I selected this option during the creation of the Textarea Option, but without any result.
    Thank you very much, now it seems to work correctly.

  • I am having a similar problem.

    I am trying to put a Google analytics code into textarea field, The google code is:

    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 977703549;
    var google_conversion_label = "wI-FCJOqxAIQ_aSa0gM";
    var google_custom_params = window.google_tag_params;
    var google_remarketing_only = true;
    /* ]]> */
    <script type="text/javascript" src="//">
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="//"/>

    but it comes out on the frontend with the noscript portion in quotes like this:

    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="//"/>

    I tried setting ‘Formatting’ to ‘Convert HTML into tags’ and that didn’t help, also tried “no Formatting” as well and I tried to get rid of the quotes with str_replace to no avail.

    Any help on this would be very much appreciated, thank you.

  • I also have the same problem!

  • Same here… did anyone solve this noscript issue?

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

The topic ‘html code into textarea’ is closed to new replies.