I am referring to post tag, and will the same extension for all tags, if a certain condition is met. The condition is that the post should has a tag. With condition i think i can sort out.
Actually I use a specific function to hide a specific tag.
Here is the code I use in function.php
function pk_the_tags( $before = '', $sep = ', ', $after = '', $exclude = '' ) {
$tags = get_the_tags();
if ( empty( $tags ) )
return false;
$tag_list = $before;
foreach ( $tags as $tag ) {
if (!empty($exclude))
$pos = stripos( $exclude, $tag->name);
else
$pos = false;
if ($pos=== false)
$tag_links[] = '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>';
}
if (empty($tag_links))
return false;
$tag_links = join( $sep, $tag_links );
$tag_links = apply_filters( 'the_tags', $tag_links );
$tag_list .= $tag_links;
$tag_list .= $after;
echo $tag_list;
}
and in single.php
<?php if (get_the_tags()) pk_the_tags('<span>', '</span><span>', '</span>', 'my_tag_name'); ?>
So the my_tag_name
will not be showed in the post with the code above.
Thanks.