0

I am trying to customise the output code of

<?php comment_form(); ?>

At the moment the submit button outputs the following:

<p class="form-submit">
    <input name="submit" type="submit" id="submit" value="Post Comment">
    <input type="hidden" name="comment_post_ID" value="486" id="comment_post_ID">
    <input type="hidden" name="comment_parent" id="comment_parent" value="0">
</p>

I would like it to output the following:

<div class="panel-footer">
    <input name="submit" type="submit" id="submit" value="Post Comment">
    <input type="hidden" name="comment_post_ID" value="486" id="comment_post_ID">
    <input type="hidden" name="comment_parent" id="comment_parent" value="0">
</div>

I now we can achieve this using css or jquery. But any solution using wordpress functions will be great.

Any suggestions greatly appreciated! :)

0

You can modify a lot of form behavior by passing $args to the comment_form() function - have you tried that?

Alternatively, you can write a custom comments template file and then use the comments_template() call to display it within the theme. This method would allow you to have complete control of the type, class, and ID of any field, provided that you hooked in to the proper WordPress functions to handle comment submission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.