Support » Plugins » Hacks » Help Needed with Menu based on tag and catagory Intesection

  • My website have categories on which i have modified so that i can put menu and images on header. i want to provide with menu (of tags) which will refine result for that category and tag. menu( based on tags) will not be used anywhere else
    references used before
    1. tdo tag fixes
    thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz


    You can build a tag menu using wp_tag_cloud() or if you don’t like the cloud thing, build a menu from the return from get_tags(). Of course this does not consider the current category. In order for your permalinks to accept both tag and category parameters, you would need to use the Rewrite API to set it up. However, if you use the traditional URL parameter form, you can build a combined tag and category_name link and it will work as expected, though the category archive is used, it is limited by the tag parameters as well.

    So you need to alter the tag link hrefs to look something like this:

    You can get the current category from the global $wp_query object.

    Please provide me with details what i exactly need to modify. I am new to api references. please provide me with more detailed reference

    Thank you

    Moderator bcworkz


    Something like this on your category template, outside the loop (untested):

    <?php $tags=get_tags();
    $cat=single_term_title(); //category name
    foreach($tags as $tag) {
       echo "<a href=\"$cat&tag=$tag->name\">$tag->name</a><br>";
    } ?>

    Of course the href needs to be altered for your site and WP location.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help Needed with Menu based on tag and catagory Intesection’ is closed to new replies.