• I need a certain code snippet to be run only if there are comments to the post in question. I’m trying to express “if there are comments to the post, do this” in php, but what’s the variable that stores the comments number?

    I have tried the following, which works on category pages but not on single posts.

    <?php if ($comments) : ?>
    (…blabla…)
    <?php endif; ?>

  • The topic ‘Conditional statement to check if there are comments to the post’ is closed to new replies.