I have tried adding using the 'class_submit' in the array, but that wraps the button in that class, making it clickable only on the button link. I want the whole button to be clickable.enter image description here

I also tried this function

 function comment_form_submit_button($button) {
    $button ='<button class="btn waves-effect waves-light" type="submit">Post Comment<i class="material-icons right">send</i>' . get_comment_id_fields();
    return $button;
add_filter('comment_form_submit_button', 'comment_form_submit_button');

It makes the whole button clickable, and I got what i wanted. But it turns out the submit button was messed up causing the comment replies to be displayed just like the ordinary comments.

Basically it made all comments as parent in the database rather than as a reply to the previous comment. ( I read this another answer )

Is there a error in the function ? or is there a easier way to achieve my idea?

1 Answer 1


There is easier way to achieve your idea. But , to be true, I cant easily understand what you need?

1) If you need just to target styling of that button, then no need to add any class. Target it using parent:

p.form-submit input#submit{  
    desired options here

2) Maybe you have error in that code. Instead, you should use just button:

$button ='<button class="btn waves-effect waves-light" type="submit">Post Comment<i class="material-icons right">send</i>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.