Support

Account

Home Forums General Issues Get HTML Tag inside Custom Text Area

Solved

Get HTML Tag inside Custom Text Area

  • Is anyway possible with a snippet, to get from a custom Text Area field with different titles and paragraphs only the <H1> and not the rest of the content.

    Something like:
    echo get_field('content_left', 'h1');

    Thanks in advanced for any feedback.

    • Elliot

    • October 31, 2013 at 3:17 pm

    Hi @blasphemine

    You can’t use the get_field in this way, but you can use some simple PHP to do so like this:

    
    $text = get_field('content_left');
    $text = explode('</h1>', $text);
    $text = current($text) . '</h1>';
    
    echo $text;
    

    Not sure if that actually works, but the logic is there.

    Thanks
    E

  • That’s a way too.
    Thank you @elliot!

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.