How do I add a class to the comment submit button? The simplified function
comment_form(array('id_submit'=>'buttonPro'));
obviously only changes the id and class_submit
does not seem to exist.
I have read through both Otto’s and Beau’s writeups but to no avail.
If you check out the source of the function comment_form()
, you’ll see it doesn’t even print a class on the input;
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
I’m guessing you need to add a class for styling? Why not modify your CSS to just;
input.submit, #buttonPro {
/* some awesome style */
}
Otherwise I guess the ‘easiest’ solution would be to simply copy the function to your functions.php
, rename it, add in a class argument & print, and use that instead – which you can find here 😉