How to prevent outputing the html label?
The code I currently have is:
<h2 id="comment_title">vistor comments</h2>
<div class="count">
<?php
$count = comment_num($nid);
if($count>0){
echo $count'comments';
} else {
echo '';
}
?>
</div>
Now, i want to know how to alter the above code to get this effect:
When $count > 0
, it should output the html label, and can use some css style to it.
<h2 id="comment_title">vistor comments</h2>and $count'comments';
When $count <= 0
, don't output the html label. and don't use any css style to it.
<h2 id="comment_title">vistor commen开发者_运维知识库ts</h2> ;
<h2 id="comment_title"><?php echo $count?> visitor comments</h2></div>
精彩评论