Simple 'no comment' code help

Hi, - I have setup a simple blog, that allows users to comment on each post.

I want to add a simple line saying ‘There are currently no comments’ when no comments have been posted, but am not 100% sure how to do so…

Here is the code where the comments are displayed…

  <?php foreach (get_comments($post['post_id'], $page) as $comment) { ?>
  <div class="main_box">
  <?php echo $counter != 0 ? '<hr />' : ''; ?> <img src="../../images/comment.jpg" alt="Comment:" title="Comment:" width="10" height="10" /> on <?php echo gmdate($user_data['date_format'], $comment['date_created'] + ($user_data['time_offset'] * 3600) + ($config['add_time'] * 3600)) . ' at ' . gmdate($user_data['time_format'], $comment['date_created'] + ($user_data['time_offset'] * 3600) + ($config['add_time'] * 3600)); ?>, <?php echo $comment['user_id'] != 0 ? $comment['username'] : $comment['name']; ?> wrote:<br />
  <br />
  <?php echo nl2br(check_output($comment['comment'])); ?>
  </div>

If any one knows of a simple way so that when there are no comments submitted, it says no comments that would be fantastic.

Cheers,

Paul


if(count(get_comments($post['post_id'], $page)) == 0) {
  echo "There are no comments";
}

Dude, you are on fire :slight_smile: - thanks!