MEET SITKA | A super-customizable modern WP theme!

Okay
  Print

How to add a comment counter to Hemlock

Please note: This FAQ Article is specifically for the Hemlock theme.





To add a comment counter to Hemlock's homepage under each post, you can follow a few easy steps. You'll need to make some slight adjustments to your theme's code. To do so, you can access the theme's file
via WordPress Dashboard > Appearance > Editor, via FTP, or via a code editor plugin such as WPide (recommended).

Please note: This will only add a comment counter to your homepage posts if you are using the standard or full-width post layout option. The Grid post layout does not have the social share icons visible on the homepage.


Within the "content.php" file on Line 96, you'll see the following line of code:

<?php comments_popup_link( '<span class="share-box"><i class="fa fa-comment-o"></i></span>', '<span class="share-box"><i class="fa fa-comment-o"></i></span>', '<span class="share-box"><i class="fa fa-comment-o"></i></span>', '', ''); ?>




You can replace that line of code with the following code instead:

<div class="comment-counter"><?php comments_popup_link('<span class="share-box">0 <i class="fa fa-comment-o"></i></span>', '<span class="share-box">1 <i class="fa fa-comment-o"></i></span>', '<span class="share-box">% <i class="fa fa-comment-o"></i></span>', '', ''); ?></div>


Be sure to save the file when you're finished.
Lastly, within WordPress Dashboard > Appearance > Customize > Custom CSS, copy & paste the following:

.comment-counter {display: inline-block;}


You're all set to go now!