WordPress.org

Ready to get started?Download WordPress

Forums

Comment validation styling (3 posts)

  1. billseymour
    Member
    Posted 3 years ago #

    Re the plain, bare error message given when a commenter fails to fill in all of the required fields (name, email, or comment message). This appears as: wordpress/wp-comments-post.php.

    After much exploration, I believe that the only way to modify the message or to style it is to alter files wp-comments-post.php (in wordpress folder), and the only css modification that works is to modify install.css (in wp-admin/css folder). Also involved is the function wp_die(), in functions.php. All of these are core files, rather than files which can be altered at the theme level.

    I am currently experimenting with plugin Comment Validation, which works very well via jQuery.

    WP feature request: Make it possible to modify at the theme level both the message and the css styling for the comment validation error message.

    I would envision the ability to create a custom template, and then create a Page, with a custom validation error message; and to then be able to tag and style this page in a theme's style.css.

    Thanks. --Bill

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    http://net.tutsplus.com/tutorials/wordpress/adding-form-validation-to-wordpress-comments-using-jquery/

    is an option

    also...the text is localised, so it can be translated. Which means I believe you can make up a language file and swap out the text. I'm not sure, but I believe you can add in markup with translation....so you could wrap the new text in spans and style that in your css

    kind of roundabout ways....there may be a more direct method

  3. billseymour
    Member
    Posted 3 years ago #

    Voodoo-
    An interesting idea. I will look into it, and hopefully this thread might generate some further thoughts. If jQuery is the way to go (which seems to also be the nettuts approach), the Comment Validation plugin is really quite successful. Thanks. --Bill

Topic Closed

This topic has been closed to new replies.

About this Topic