Support » Plugins and Hacks » Link to current category using different anchor text
5 years, 10 months ago
I would like to link to the current category using different anchor text. I would like to do the same thing for the current tag. help please! thank you!
[no bumping, please]
Ok. So this is what I have so far:
$the_cat = get_the_category();
$category_name = $the_cat->cat_name;
$category_description = $the_cat->category_description;
$category_link = get_category_link( $the_cat->cat_ID );
$the_tag = get_the_tags();
$tag_name = $the_tag->tag_name;
$tag_description = $the_tag->tag_description;
$tag_link = get_tag_link( $the_tag->tag_ID );
<a href="<?php echo $category_link; ?>">some text A</a> : <a href="<?php echo $tag_link; ?>">some text B</a>
This code works fine on my tag pages but on my category pages the “some text B” link or the link that is suppose to link to the current corresponding tag page, links to the current category.
Any help with this?