check if comments wordpress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. if (get_comments_number()==0) {
  3. // post has no comments
  4. } else {
  5. // post has comments
  6. }
  7. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.