{"id":125888,"date":"2014-02-16T11:30:00","date_gmt":"2014-02-16T16:30:00","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=125888"},"modified":"2014-02-26T20:33:32","modified_gmt":"2014-02-27T01:33:32","slug":"improving-the-look-and-feel-of-your-author-comments","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/improving-the-look-and-feel-of-your-author-comments\/","title":{"rendered":"Improving the Look and Feel of Your Author Comments"},"content":{"rendered":"<p>When you&#8217;ve spent a lot of time writing a post, it&#8217;s a good feeling when you get a tonne of comments.<\/p>\n<p>The problem is, when you get so many comments you can&#8217;t keep track of who&#8217;s who and your own comments get buried amongst everyone else&#8217;s because they blend right in.<\/p>\n<p>Many readers like to scan through comments after reading a post just so they can see whether the author had responded to feedback. Styling author comments provides as easy way for your readers to quickly find what you&#8217;ve written when there&#8217;s a heap of discussion going on.<\/p>\n<p>For today&#8217;s Weekend WordPress Project, I&#8217;m going to show you how to style your author comments so they stand out from the crowd.<\/p>\n<div class=\"image-grid cgrid-row\">\n<div class=\"cgrid-col cgrid-col-span-full\"><a rel=\"lightbox[125888]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/feature2.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-ratio-large wp-image-126157\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/feature2-700x218.jpg\" alt=\"Feature image\" width=\"700\" height=\"218\" \/><\/a><\/div>\n<\/div>\n<h2>Styling Author Comments Using CSS<\/h2>\n<p>For this project, I&#8217;m going to style the Twenty Fourteen theme, but this neat CSS hack should work for any theme.<\/p>\n<p>This is what the comments section on my site looks like at the moment:<\/p>\n<figure id=\"attachment_126149\" class=\"wp-caption aligncenter\" data-caption=\"true\"><a rel=\"lightbox[125888]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/comments-section.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-126149\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/comments-section.png\" alt=\"Comments section\" width=\"501\" height=\"443\" \/><\/a><figcaption class=\"wp-caption-text\">A regular ol&#8217; comments section in Twenty Fourteen.<\/figcaption><\/figure>\n<p>As you can see, the admin post looks similar to a regular comment except for the star next to the admin username, which indicates the comment was written by me, the author.<\/p>\n<p>While the little star is a helpful marker for author comments, it&#8217;s too small to really catch your eye when you&#8217;re scrolling through a busy comments section.<\/p>\n<p>To add a bit of oomph to your author comments, take advantage of the <em>bypostauthor<\/em> class and add the following code to your CSS file:<\/p>\n<pre>li.bypostauthor {\r\nbackground:#ffffcc;\r\ncolor:#cc3300;\r\n}<\/pre>\n<p>Now my comments look like this:<\/p>\n<figure id=\"attachment_126151\" class=\"wp-caption aligncenter\" data-caption=\"true\"><a rel=\"lightbox[125888]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/author-comments.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-126151\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/author-comments.png\" alt=\"Author comments\" width=\"502\" height=\"435\" \/><\/a><figcaption class=\"wp-caption-text\">Jazz up the author comments in your posts by using the bypostauthor CSS class.<\/figcaption><\/figure>\n<p>The code adds a light yellow background and red text, helping the comments (and subsequent author comments) it to stand out from all the other comments in your post.<\/p>\n<p>If you want to get a bit fancier still and experiment with CSS, you may like to add a gradient instead:<\/p>\n<figure id=\"attachment_126153\" class=\"wp-caption aligncenter\" data-caption=\"true\"><a rel=\"lightbox[125888]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/gradient-comments.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-126153\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/02\/gradient-comments.png\" alt=\"Gradient comments\" width=\"491\" height=\"438\" \/><\/a><figcaption class=\"wp-caption-text\">Add a gradient to your author comments.<\/figcaption><\/figure>\n<p>The code for adding this gradient is:<\/p>\n<pre>li.bypostauthor {\r\nbackground-color: #eef4ef;\r\nbackground-image: -webkit-gradient(linear, left center, right center, from(rgb(238, 244, 239)), to(rgb(201, 199, 195)));\r\nbackground-image: -webkit-linear-gradient(left, rgb(238, 244, 239), rgb(201, 199, 195));\r\nbackground-image: -moz-linear-gradient(left, rgb(238, 244, 239), rgb(201, 199, 195));\r\nbackground-image: -o-linear-gradient(left, rgb(238, 244, 239), rgb(201, 199, 195));\r\nbackground-image: -ms-linear-gradient(left, rgb(238, 244, 239), rgb(201, 199, 195));\r\nbackground-image: linear-gradient(left, rgb(238, 244, 239), rgb(201, 199, 195));\r\nfilter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#eef4ef', EndColorStr='#c9c7c3');\r\n}<\/pre>\n<p>And there you have it. Experiment with styling the comments on your own site and help your readers find your voice in the discussion.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you&#8217;ve spent a lot of time writing a post, it&#8217;s satisfying when you get a lot of comments. The problem is, when you get so many comments you can&#8217;t keep track of who&#8217;s who and your author comments blend in with everyone else&#8217;s. For today&#8217;s Weekend WordPress Project, I&#8217;m going to show you how to style your author comments so they stand out from the crowd.<\/p>\n","protected":false},"author":164650,"featured_media":126157,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[9798],"tutorials_categories":[],"class_list":["post-125888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-weekend-wordpress-projects"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/125888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/164650"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=125888"}],"version-history":[{"count":1,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/125888\/revisions"}],"predecessor-version":[{"id":193575,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/125888\/revisions\/193575"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/126157"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=125888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=125888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=125888"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=125888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}