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}
:
{exp:weblog:entries weblog="{master_weblog_name}" RDF="off"}
{if comment_total == 0}
No comments yet.
{/if}
{/exp:weblog:entries}
{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}
{if trackback_total == 0}
No trackbacks yet.
{/if}
{/exp:weblog:entries}
Thanks to Les Jenkins for the tip in the pmachines forum.
The trackback URL for this entry is: Trackbacks are disabled for this entry
Trackbacks:
No trackbacks yet.
Comments:
No comments yet.
Next entry: Trifecta
Previous entry: Multiple Categories Separated by Commas
