MEET SITKA | A super-customizable modern WP theme!

Okay
  Print

How to add a comment counter to Florence

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





To add a comment counter to Florence's homepage under each post, you can follow a few easy steps. 

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 List and Grid post layouts do not have the social share icons visible on the homepage.

Navigate to WP Dashboard > Plugins > Plugin Editor.
In the upper-right of the screen, you'll see a drop-down menu with the words "Select plugin to edit". 
From this drop-down, choose the "Florence Core" plugin. Click the "Select" button. 
On the right, click the "inc" folder. 
Finally, open the file titled "social_share.php". 

On Line 27, you'll see the following line of code:


<?php if ( comments_open() ) : ?><a href="<?php echo get_permalink(); ?>#comments_wrapper"><i class="fa fa-comments"></i></a><?php endif; ?>


Replace that line of code with the following code instead:


<?php if(comments_open()) : ?>
    <div class="comment-counter"><?php comments_popup_link('No Comments', '1 Comment', '% Comments', '', ''); ?></div>
<?php endif; ?>


Save the file when you're finished.


Next, navigate to WP Dashboard > Appearance > Theme Editor > and open up the "comments.php" file.
On Line 2, you'll see this line of code:

<div class="post-comments" id="comments_wrapper">


Replace that line of code with the following instead:

<div class="post-comments" id="comments">


Save changes to the file when finished. 

Lastly, within Appearance > Customize > Custom CSS/Additional CSS, copy & paste the following: 


.comment-counter {
display: inline-block;
margin-left: 15px;
}


Save changes.