WordPress.org

Ready to get started?Download WordPress

Forums

Remove formatting (comment plugin) (1 post)

  1. thornomad
    Member
    Posted 7 years ago #

    Hi,

    I am using a comment plugin on my site http://www.damonjustisntfunny.com

    I am using the function that displays some of the text from the most recent comment in a list (and links to the full comment). This works well UNLESS there is any sort of html formatting in the comment ...

    For example, if there is a <a href= tag in the beginning of the comment, the function will output the text, plus the beginning of the <a href= tag, but not close the tag ... and this causes for some whacky results.

    Where the comment text is added in the function is on this line:

    echo substr($comment->comment_content,0,$length);

    Is there any way to stip whatever content is being pulled of its html tags ?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.