Example 1 — Any tag archive
Print a label above the posts.
<?php if ( is_tag() ) {
echo '<p>Tag: ' . single_tag_title( '', false ) . '</p>';
} ?> How It Works
is_tag()is true only on tag archives.single_tag_title()returns the name when the second argument isfalse.- Other pages skip the code.

