<?php if (has_comments()) ?> ?
-
I want one div (#comments-area) to show up if a post has comments and another div(#no-comments-area) to show up when a post has no comments. How would I do this? Below is my failed attempt. I would really appreciate any help. Thanks.
<?php if(has_comments()) { echo <div id="comments-area"> <?php comments_template(); ?> </div> } else { echo <div id="no-comments-area"> <?php comments_template(); ?> </div> } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘<?php if (has_comments()) ?> ?’ is closed to new replies.