WordPress.org

Ready to get started?Download WordPress

Forums

Comments cut off by Less-Than sign (2 posts)

  1. kabitzin
    Member
    Posted 7 years ago #

    When I myself want to insert a < sign, I know to type in &lt;. However, the average commenter does not know to do this and is completely baffled when the majority of his/her comment gets cut off after a less-than symbol.

    Is there a plugin or a hack that I could implement to ensure that (at the very least) the rest of the comment after the less-than sign is not truncated. Commenters sometimes use it in ASCII faces and then have to retype their comment, which is a pain.

    I tried the Preserve Code plugin, but it only seems to work if you are a logged in user. Random people still continue to have the same problem. Is there something in the kses.php file that I would need to change to allow everyone to use the less-than sign without losing most of their comment?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    I have not actually tried this, but try adding this to your theme's functions.php:

    <?php
    add_filter('pre_comment_content', 'wp_specialchars', 10);
    ?>

    Make a new functions.php file if you don't already have one. And make *sure* that the functions.php file contains no blank space at the beginning or end of the file. It must start with <?php and end with ?>.

Topic Closed

This topic has been closed to new replies.

About this Topic