How do I add the word "comment"?

  • 2
  • Question
  • Updated 8 years ago
I have another would I add the word "comments" to the information above each post. On the same line as the date.....thanks!
Photo of Jack Fussell

Jack Fussell

  • 6 Posts
  • 0 Reply Likes

Posted 8 years ago

  • 2
Photo of Andrea Mignolo

Andrea Mignolo, Official Rep

  • 78 Posts
  • 7 Reply Likes
Official Response
So, to add the word "comments" you'll need to edit both index.php and single.php. Look for the following line:

<p class="date"><?php the_time('F jS, Y') ?> <?php comments_popup_link('§ <span class="commentcount">0</span>', '§ <span class="commentcount">1</span>', '§ <span class="commentcount">%</span>'); ?></p>

This snippet displays three comment states - if there are no comments, if there is one comment, and if there is more than one comment. You are interested in the bits inside the parenthesis of comments_popup_link() - in case you want to change this again in the future. For now, just replace that bit of code with the following:

<p class="date"><?php the_time('F jS, Y') ?> <?php comments_popup_link('§ <span class="commentcount">0 comments</span>', '§ <span class="commentcount">1 comment</span>', '§ <span class="commentcount">% comments</span>'); ?></p>

That should do it!