Display Text if No Comments

If you would like your EE blog to display something like “No comments yet” if there have not been any comments posted, it is very easy to do. Add the following code just before your comments loop begins (i.e. just before {exp:comment:entries}wink:



{exp:weblog:entries weblog="{master_weblog_name}" RDF="off"}


{if comment_total == 0}


No comments yet.


{/if}


{/exp:weblog:entries}




You can do the same thing with trackbacks like this:



{exp:weblog:entries weblog="{master_weblog_name}" RDF="off"}


{if trackback_total == 0}


No trackbacks yet.


{/if}


{/exp:weblog:entries}


Thanks to Les Jenkins for the tip in the pmachines forum.


Posted on September 28, 2004 at 07:18 PM in Tips
Email this entry

The trackback URL for this entry is: Trackbacks are disabled for this entry

Trackbacks:

No trackbacks yet.

Comments:

No comments yet.