How to realize conditional "if_comment_exists"? (2 posts)

  1. michaelkalina
    Posted 8 years ago #

    There are various way to display a comment invitation, but how can I realize something like that:

    • If there are no comments, nothing happens.
    • If there is one or more comments, a comment-icon is shown.

    I was in search of a conditional-tag telling me whether there are or not comments, but I did not find anything. Any help on this?

  2. michaelkalina
    Posted 8 years ago #

    <?php if($post->comment_count > 0) : ?>
     <a href="<?php the_permalink() ?>#comments" ><img src="IMAGE-GOES-HERE" style="border: 0;" /></a>
    <?php else : ?>
    <?php endif; ?></p>

Topic Closed

This topic has been closed to new replies.

About this Topic