Support » Plugins » Link to current category using different anchor text

  • 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]

Viewing 1 replies (of 1 total)
  • Ok. So this is what I have so far:

    <?php
    $the_cat = get_the_category();
    $category_name = $the_cat[0]->cat_name;
    $category_description = $the_cat[0]->category_description;
    $category_link = get_category_link( $the_cat[0]->cat_ID );
    ?>
    
    <?php
    $the_tag = get_the_tags();
    $tag_name = $the_tag[0]->tag_name;
    $tag_description = $the_tag[0]->tag_description;
    $tag_link = get_tag_link( $the_tag[0]->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?

Viewing 1 replies (of 1 total)
  • The topic ‘Link to current category using different anchor text’ is closed to new replies.