WordPress.org

Ready to get started?Download WordPress

Forums

Changing the wording for Facebook comments when there is only one comment (1 post)

  1. laurenmichell
    Member
    Posted 2 years ago #

    I'm using Facebook comments and using this code to generate a comment count:
    <a href="<?php the_permalink() ?>#comments" class="commentCount"><?php fb_comment_count() ?> comments</a>

    However, if I only have one comment on a post, it displays as "1 comments" instead of "1 comment."

    What's the best way to interact with the Facebook API to say something like: If comment count = 1, echo fb_comment_count comment. Else, echo comments?

Topic Closed

This topic has been closed to new replies.

About this Topic