Highlighting Author Comments in Posts & Pages

No Comments

One of the real strengths of a WordPress site is the Comment system. It allows the site owner or author to engage in a dialogue with his or her visitors.  On many sites, this exchange of information, ideas and opinions can often end up adding more value to the page than the original article itself!

A good author replies to the comments of her visitors; adding value, acknowledging good points and countering bad ones.  However, as this exchange grows, it is easy for the author’s input to get lost in the flood.  You may have seen some sites using various techniques to help readers quickly identify the author’s comments from among the stream of entries. One such technique is to give author comments a special background color:

ItsWordPress Highlighting Author Comments

The following is an easy modification of your WordPress theme to achieve this effect.

NOTE: You should have a passing familiarity with CSS and HTML and a comfort modifying template files and updating/uploading them. Always backup your files before making any changes.

The first step is to identify the CSS class (if any) your theme may already use to distinguish author comments from other visitor’s comments.  In modern themes this is often something like “bypostauthor” or “entry-author”.  You can do this by visiting a page or post on your site where you (the author) has left a comment and using the View Source function of your web browser.

Once you have found the CSS class you need, add or modify its entry in the style.css of your site’s style.css. This file can be found in the template folder for your current site theme (wp-content/themes/XXXX/style.css).  Choose a background color that is sufficiently different to make the comment standout, but not so dramatic that is obscures your text color or merges with other elements of your page. The example below is a sort of post-it yellow.

.bypostauthor { background-color: #B3FFCC !important; }

Once you’ve updated the style.css, your author comments highlighting should immediately take effect upon refreshing any page/post that contains author comments.

Combined with some basic PHP knowledge, this simple effect can be expanded to achieve other comment effects such as:

  • Site Admininstrator highlighting
  • Highlighting comments from guests/non-members
  • Highlighting comments by site member rank

Need help implementing this tip in your WordPress site?  Contact us for our professional services.  We can also provide support & expertise in convenient “blocks” to suit your short and long term needs.




I'm the front-man of It's WordPress. I come from a diverse array of backgrounds, enjoying the opportunity to expand my knowledge base and skill set by re-inventing myself. I enjoy environments that focus on emerging information, technology and concepts. I put on the technical hat in my early 20s and never really looked back. I'm love technology and the internet, as well as the outdoors and avidly hike, kayak and camp every chance I get.

About Us

We can take you from concept, through design, development and deployment in one seamless process. Whether you choose a self-managed web site or need a continuing support relationship; we've got you covered.

Request Consulation

Ready to transform your vision into a reality? Just looking to see what it takes to get the ball rolling. Tell us about your project and we can help. No spam. No obligation. Just answers.

More from our blog

See all posts