WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Disabling HTML tags from post content (5 posts)

  1. cnts
    Member
    Posted 6 years ago #

    Hi there...

    I'm running a website that shows a certain custom value for each post on the front page... but when this custom value has a link tag inside... the website's composition breaks...

    What I need to do is strip the HTML tags from this custom values... and I know some will say "hey... why not use excerpt"... thing is I only need the custom value to show... and it must be stripped of all HTML tags...

    Any ideas anyone???...

    Thanks in advance...

  2. Kafkaesqui

    Posted 6 years ago #

    Before suggesting a solution, it would help to know how you are displaying the custom value. Are you using a plugin, a built-in WP method, of something custom coded?

  3. cnts
    Member
    Posted 6 years ago #

    Ah sure... I'm modifying a version of Darren Hoyt's Mimbo Theme... And by his indications you're supposed to display custom fields using:

    <?php $values = get_post_custom_values("THE_CUSTOM_FIELD"); echo $values[0]; ?>"

    Have no idea if that script has any variables... Maybe I should ask Darren first... Just thought maybe there was a "wordpress official" way of doing it...

    Still if you have any ideas... I'd most apreciate that...

  4. Kafkaesqui

    Posted 6 years ago #

    Change the echo to:

    echo strip_tags($values[0]);

  5. cnts
    Member
    Posted 6 years ago #

    yeeeah Kafkaesqui... works great!!!... you rock man... thanks!...

Topic Closed

This topic has been closed to new replies.

About this Topic