WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Disabling HTML tags from post content

[Resolved] Disabling HTML tags from post content

  • 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…

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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?

    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…

    Change the echo to:

    echo strip_tags($values[0]);

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Disabling HTML tags from post content’ is closed to new replies.
Skip to toolbar