How can you edit a WordPress comment

5 beauty tips for your WordPress comment area

Comments make a blog come alive. The following five tips will bring your comment area to life.

The comment area of ​​most WordPress themes can be described as soberly functional. It's practical, but not very inviting. But what makes an appealing comment area? For example, a separate heading for the form, highlighted author comments, individual colors, pagination for posts with many comments and the option to like comments. If you want all of this, you should read on.

Tip 1: highlight comments

To distinguish the comments and the form fields from the background in color, you simply adapt them using CSS. All instructions come as usual in the style.css of the child theme

// highlight reader comments .comment-body {background: # f8f8f8; }

Conveniently, WordPress assigns a separate class for author comments.bypostauthor. This allows you to differentiate them from the others with a darker background color or a frame:

// highlight author comments .bypostauthor> article {border-right: # cd2653 solid 10px; }

Tip 2: change the heading for the comment area

By default, the heading is "Leave a comment". To change that, load the file in the theme directory comments.php and add to the array of the function comment_form (); the following lines:

// "Leave a comment" change 'title_reply ‘=>' Tell me your opinion! ',

In the editor it looks like this:

Instead of "Tell me your opinion!" You can of course insert anything else. Then you load the file into the main directory of your child theme.

Tip 3: remove field for website

With the following lines you remove the form field for the website from the comment area. Just paste the code into the functions.php Of your child theme:

// Remove website field from comment area add_filter ('comment_form_default_fields', 'remove_website_field'); function remove_website_field ($ fields) {if (isset ($ fields [‚url‘])) unset ($ fields [‚url‘]); return $ fields;

Now the cookie notice with the checkbox is no longer displayed correctly. To fix this, write the following instruction in the style.css:

// Align the cookie notice .comment-form-cookies-consent {display: inline-flex; }

Tip 4: pagination for posts

Performance and overview suffer from a high number of comments. In this case, it makes sense to divide the comment area over several pages. To do this, you use the backend Settings -> discussion a check mark next to »Break comments into pages (...)«.

In the frontend, links to older and newer comments appear below the comment area. This allows your visitors to better understand the feedback on your blog.

Tip 5: add like buttons

Likes and favorites are part of everyday digital life. Still: Although rating other posts increases interaction, most blogs do without this feature. It's so easy with the Comments Like Dislike plugin. After you have installed and activated the plugin, you can go to the plugin settings under the tab Design settings even choose templates and color.

In this example we have chosen thumbs in the standard color of the Twenty Twenty theme (# cd2653):

Note: We updated this post on November 26th, 2020.