Support

Account

Home Forums Front-end Issues html code into textarea

Solved

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="//www.youtube.com/embed/3f7l-Z4NF70?rel=0" 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’.

    Thanks
    E

  • 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>
    <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/977703549/?value=0&label=wI-FCJOqxAIQ_aSa0gM&guid=ON&script=0"/>
    </div>
    </noscript>

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

    <noscript>
    "
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/977703549/?value=0&label=wI-FCJOqxAIQ_aSa0gM&guid=ON&script=0"/>
    </div>
    "
    </noscript>

    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.