How to echo current tag slug
-
On a category.php the following works to echo the current category slug:
<?php
if (is_category()) {
$yourcat = get_category ($cat);
echo ‘the slug is ‘.$yourcat->slug;
}
?>Please could someone tell me how to modify this so that on tag.php I can echo the current tag slug. I have tried everything.
Thank you.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to echo current tag slug’ is closed to new replies.