lundi 28 décembre 2015

Mutiple "if" conditions

So I got this code that gets a caption for how many comments there are in each post of my blog

$pego_comment_caption = " Comments";

if (get_comments_number($post->ID) == 1) {
    $pego_comment_caption = " Comment";
}

Since I'm more of a grammar nazi than I understand PHP, "0 Comments" is actually gramatically incorrect since 0 is less than 1 and.. well, you know

I'd like to change the if conditions making it display the word "Comment" instead of "Comments" when there are 0 OR 1 comment. It's probably simple but I couldn't do it. Does anybody know how to?

Aucun commentaire:

Enregistrer un commentaire