Jennifer Zelazny

Random and Opinionated Thoughts

Add Bootstrap Button Classes to the WordPress Comment Form

CSS Hints HOWTOs WordPress
Posted by: Jennifer Zelazny | 0 Comments

Looking to stylize that WordPress comment button on the WordPress comment form? Adding the correct classes needed to the comment form button are as easy as finding where comment_form() is called in your theme.

In my cases – this is within the comments.php file.

Once you find that – you just need to change
comment_form()
to:

$args = array(
'class_submit' => 'btn btn-default',
);
comment_form($args )

There are a number of modifications you can make to the comment form (changing button text, changing labels, adding notes, etc that you can make with the comment_form() function which are worth looking at here: https://codex.wordpress.org/Function_Reference/comment_form