If you want to add some custom HTML between the </h3>
and the <form>
tags, you can try the following:
/**
* Add custom HTML between the `</h3>` and the `<form>` tags in the comment_form() output.
*/
add_action( 'comment_form_before', function(){
add_filter( 'pre_option_comment_registration', 'wpse_156112' );
});
function wpse_156112( $comment_registration )
{
// Adjust this to your needs:
echo '<div>Custom HTML between the closing H3 and opening FORM tags.</div>';
remove_filter( current_filter(), __FUNCTION__ );
return $comment_registration;
}
where the output is:
...</h3>
<div>Custom HTML between the closing H3 and opening FORM tags.</div>
<form>...
Otherwise you can use the comment_form_top
action to add custom HTML right after the opening <form>
tag:
/**
* Add custom HTML just after the opening `<form>` tag in the comment_form() output.
*/
add_action( 'comment_form_top', function(){
// Adjust this to your needs:
echo '<div>Custom HTML just after the opening FORM tag.</div>';
});
with the following output:
<form>
<div>Custom HTML just after the opening FORM tag.</div>
...
Here you can see the comment form of the TwentyTwelve theme with both methods activated: