gartlans
Member
Posted 1 year ago #
If the author has not included a post tag in the post, is it possible to display a standard text description "No Tags Found"??? So if a post tag is found, display it, if not, then output standard text "No Tags Found"...
I'm currently using in single.php;
<p class="tags"><?php the_tags('Tags: ', ' | ', ''); ?>
Thanks,
<?php if( get_the_tags() ) { ?>
<p class="tags"><?php the_tags('Tags: ', ' | ', ''); ?></p>
<?php } else { ?>
<p class="tags">No Tags Found</p>
<?php } ?>
http://codex.wordpress.org/Function_Reference/get_the_tags
gartlans
Member
Posted 1 year ago #
Thanks Alchymyth that's perfect!!! :) Thanks for taking the time to share your knowledge, I appreciate it...
pmagony
Member
Posted 7 months ago #
This is a quick fix, but if you want to do it at the root of the categories file, you need to open wp-includes/category-template.php
Line: 536
You'll find this:
if ( empty( $tags ) || is_wp_error( $tags ) )
return;
Replace with this and customize your text to taste:
if ( empty( $tags ) || is_wp_error( $tags ) ) {
echo "<p>There are currently no associated tags.</p>";
return;
}