WordPress.org

Support

Support » How-To and Troubleshooting » How to realize conditional “if_comment_exists”?

How to realize conditional “if_comment_exists”?

  • michaelkalina

    @michaelkalina

    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?

Viewing 1 replies (of 1 total)
  • michaelkalina

    @michaelkalina

    <?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>
Viewing 1 replies (of 1 total)
  • The topic ‘How to realize conditional “if_comment_exists”?’ is closed to new replies.
Skip to toolbar