Support » Plugin: Multi-column Tag Map » How to link tag in list to a specific post

  • Resolved blogdropper


    Hi, I’m using mctagmap to list taxonomies. Each taxonomy appears in a single post, how can I redirect the link to the post the taxonomy appears on?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tugbucket


    Sorry for the delay. Both your topics are essentially the same. By default a tag link will direct to the archive for the tag. If you are ever only going to have 1 unique tag for each post or rather each tag used only belongs to a single post, then the tag link default isn’t going to work. You’re better off rolling your own solution.

    You can try to work in this:

    $tag = 'apple';
    $the_query = new WP_Query( 'tag='.$tag);
    if ( $the_query->have_posts() ) {
        echo '<ul>';
        while ( $the_query->have_posts() ) {
            echo '<li><a href="' . get_the_permalink() . '">'.$tag.'</a></li>';
        echo '</ul>';
    } else {
        // no posts found
    Thread Starter blogdropper


    Thanks for getting back to me.
    I have Toolset, contacted their support and they came up with this solution:


    function redirect_my_custom_tax_archive_to_post() {
    if (is_tax(‘english-name’)) {
    global $post;
    Works great!

    Plugin Author tugbucket


    @blogdropper oh that’s nifty. Going to save that one.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to link tag in list to a specific post’ is closed to new replies.