You may be able to do what you want by adding an action to the
‘comment_form_before’ hook. Try adding something like this to your functions.php:
add_action( 'comment_form_before', 'my_pre_comment_text' );
function my_pre_comment_text() {
echo '<div class="mytext"><p>I want some text here before the comments.</p></div>';
}
Of course, you will probably also need to add some styling.
Where is the comment_form_before hook located? I cannot find it in the functions.php.
The code I gave goes into your functions.php. comment_form_before hook is built into WP – it is not in the theme’s files.
But, be careful, you may need to enclose the code in php tags. If you make a mistake, you may not be able to log in to your site to correct it. Don/t add the code unless you are sure it is going to be OK.
(@sugarpeach)
14 years, 4 months ago
I’m using the Admired theme. I want to add text above the comment box. From reading previous threads about adding text, it seems that I have to edit my comments.php. Where should I edit?