I currently have the following trying to avoid showing tags (the icon in this case) when there aren’t any, but the icon continues to show up. Any thoughts?
<?php if ( is_singular() && function_exists('the_tags') ) : ?>
<p><i class="icon-tags"></i><?php the_tags('', ', ', ' '); ?></p>
<?php endif; ?>
Get a string value for the tags and print it only if there are tags:
you could also add the html into the ‘before’ parameter of
the_tags()
for example reducing your whole code to one line: