In this tutorial, i’ll provide the PHP code you can use with any theme to change the text displayed before and after your comments form.
By default, WordPress generates comment notes that include text before and comment form allowed tags after your form which you may want to remove or customize.
Here’s the default form :
And here’s an example of what you can do simply by adding the code at the end of your child themes functions.php file and customizing the text in the code:
Here’s the code which i have modified as per the screenshot above:
One benefit of using this code is that it removes the comment form allowed tags. You can also achieve this by installing this plugin.
Its very easy to style because the code includes the comments-notes class which you can paste at the end of your child themes style sheet and add your own declarations.
You can also change the comments-notes class in the PHP code above if you want to style the before and after notes differently.
.comment-notes {
color: blue;
}
The code in this tutorial enables you to easily modify the default text and add a comment form policy, HTML or pretty much anything else.
Other Options
- Customize Comment Form Place Holder Input Text Fields & Labels
- Remove Comments From Specific Posts and Different Categories
- Customize Comment Form Text Area & Label
- Style Comment Form Submit Button
Pretty basic stuff, what do you think?
Leave a Reply
You must be logged in to post a comment.