Query Multiple Taxonomies
[resolved] [Plugin: Taxonomy Drill-Down] How to display tag's name of the 2nd taxonomy requested in url ? (6 posts)

  1. bouddhalight
    Posted 4 years ago #


    I have a custom post type with many many taxonomies. This is why I use this plugin.

    Here is my problem, For example :

    I would like to display (in my header.php template) the tag's name of only taxonomyB is it requested in url.

    I tried to use the following lines of code but it doesn't work :

    if (is_multitax( array('taxonomyB') )) {
    $taxonomyB_term = get_term_by( 'slug', get_query_var('term'), get_query_var('taxonomyB') );
    echo $term->name;

    If anyone knows... ? :/


  2. bouddhalight
    Posted 4 years ago #

    Ok, I got it.

    if (is_multitax( array('taxonomyB') )) {
    foreach (qmt_get_query() as $tax => slug) {
      $tag = get_term_by( 'slug', $slug, $tax );
      if ( $tag->taxonomy == "taxonomyB") {
        echo $tag->name;

    [Please post code snippets between backticks or use the code button.]

    the foreach missed. ^^

  3. scribu
    Plugin Author

    Posted 4 years ago #

    Glad to see you've managed on your own. :)

    Note that that if (is_multitax( array('taxonomyB') )) { check will not work for this url:


    You can just remove the if check and it should work as expected.

  4. bouddhalight
    Posted 4 years ago #

    Thanks Scribu :)

    I have another question:
    I have to implement a menu "cities". The user can choose a city (or not) wich is a term of "city" taxonomy.
    So the url could be like that :

    How can i set up your plugin to consider the city term ? :)

  5. bouddhalight
    Posted 4 years ago #

    Scribu ? please... :D

  6. bouddhalight
    Posted 4 years ago #

    I create new topic for the last question.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Query Multiple Taxonomies
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic