WordPress.org

Ready to get started?Download WordPress

Forums

Delete the html message in comments (17 posts)

  1. lukasgrijander
    Member
    Posted 4 years ago #

    There is a messague in the comment section of autofocus. This message say:

    You may use these HTML tags and attributes: <abbr title=""> <acronym title=""> <b>

    <cite> <del datetime=""> <i> <q cite=""> <strike>

    Powered by WP Hashcash

    Any body knows hot to delete it?

    Thanks!

  2. lukasgrijander
    Member
    Posted 4 years ago #

    you can see what i´m talking about at the end of this web

    http://www.ntalberto.com/?p=463

    regards

  3. iistudios
    Member
    Posted 4 years ago #

    You could try editing the comments.php file

    <div id="form-allowed-tags" class="form-section">
    	              <p><span><?php _e('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'your-theme') ?></span> <code><?php echo allowed_tags(); ?></code></p>
                  </div>
  4. lukasgrijander
    Member
    Posted 4 years ago #

    this is all my comments php file. Y don´t know which part i need to modify.

    thanks!!

    [Code moderated as per the Forum Rules. Please use the pastebin]

  5. iistudios
    Member
    Posted 4 years ago #

    Delete the following as it appears to only echo the html info.
    <p><span><?php _e('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'your-theme') ?></span> <?php echo allowed_tags(); ?></p>
    I tried it and it worked.

  6. lukasgrijander
    Member
    Posted 4 years ago #

    i have done it but the footer has been moved to the left side.

    It doesn´t works. I would like to hide the hmtl message insted of delete it. Do you know the code for hide it?

    thanks another time

  7. lukasgrijander
    Member
    Posted 4 years ago #

    can anybody help me?

  8. grosbouff
    Member
    Posted 4 years ago #

    For WP3;

    You have to filter the arguments from the function function comment_form (wp-includes/comment-template.php)

    I did it like this, addind this code in the functions.php of my theme :

    function mytheme_init() {
    	add_filter('comment_form_defaults','mytheme_comments_form_defaults');
    }
    add_action('after_setup_theme','mytheme_init');
    
    function mytheme_comments_form_defaults($default) {
    	unset($default['comment_notes_after']);
    	return $default;
    }
  9. WP Voyager
    Member
    Posted 4 years ago #

    I would like to hide the hmtl message insted of delete it. Do you know the code for hide it?

    To hide the code, comment it out. To do this, put an opening <!-- and a closing --!> around the parts that you want to remove.

    In your case, it would look something like this:

    <!-- <p><span><?php _e('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'your-theme') ?></span> <?php echo allowed_tags(); ?></p> --!>

    See if that works,
    MindBlender 3D

  10. lukasgrijander
    Member
    Posted 4 years ago #

    thanks but now doing this the buttom of POST A COMMENT has been moved, i´dont know what to do for hide the text wothoutmoving the buttom

    thankyou very much!!!

  11. aradams
    Member
    Posted 4 years ago #

    Thanks grosbouff for your solution!

  12. MarQ_ZA
    Member
    Posted 4 years ago #

    To hide it, just modify your theme's CSS stylesheet and add:

    .form-allowed-tags { display: none; }

    Otherwise grosbouff's method is good. You want to avoid editing the original WordPress files.

  13. Elio Rivero
    Member
    Posted 3 years ago #

    Just set 'comment_notes_after' to '' when you call comment_form

    <?php comment_form(array('comment_notes_after' => '')); ?>

  14. Gouri
    Member
    Posted 3 years ago #

    Go to the style sheet (style.css) & look for the following piece of code:

    #respond .form-allowed-tags {
    color: #888;
    font-size: 12px;
    line-height: 18px;
    }

    Now add the following towards the end:
    display: none;

    So that the final code looks like this:

    #respond .form-allowed-tags {
    color: #888;
    font-size: 12px;
    line-height: 18px;
    display: none;
    }

    Let me know if this works.

  15. Artur Bezerra
    Member
    Posted 3 years ago #

    The content of a plugin to erase any thing in 'comment_notes_after' can be this:

    function mytheme_init() {
    add_filter('comment_form_defaults','mytheme_comments_form_defaults');
    }
    add_action('after_setup_theme','mytheme_init');
    function mytheme_comments_form_defaults($default) {
    	unset($default['comment_notes_after']);
    	return $default;
    }

    But don't works on any theme. In the default theme "Twenty Ten", works fine, but in the Suffusion don't works. The theme overwrite this filter. What can I do to override the choices of the theme?
    What hook can I use to overwrite options of the theme?

  16. Joey Snijders
    Member
    Posted 3 years ago #

    @MarQ_ZA Thanks your trick work for me :)

  17. aradams
    Member
    Posted 3 years ago #

    After using grosbouff's suggestion above, WP will throw an error in debug mode (for testing themes.)

    Undefined index: comment_notes_after in [...]/wp-includes/comment-template.php on line [...]

    I believe this happens because in the comments template WP doesn't check first to see that each item in the the array exists. This isn't a big problem but when I'm developing a theme I shoot for zero errors.

    So I am going to use Gouri's suggestion instead to use CSS to hide the text.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags