• I’m not exactly sure how to explain this, but I’ll do my best.
    I manage an adoption website for dogs. I have the taxonomies “status” and “contact” which I fill out for each animal (“status” is either “adopted” or “available”, and the “contact” is the person in charge of that dog). When someone is viewing the page for the contact “Jill”, it shows a nice list of all posts with “Jill” as the contact. The description for the term “Jill” is her email address, which is displayed between the archive title and the post results. So it looks like:
    Posts classified under: Jill
    Email: [email protected]
    [list of all posts with Jill as contact]

    Here is a real world example on my site: https://wolfdogrescue.net/contact/deanna/

    Now unfortunately, some of the animals listed under Jill will also have the status “adopted”. I need a way to view the animals that are associated with Jill AND have only the status “available”. The QMT plugin has been the only solution I have found, but with some major problems.
    When I am on Jill’s page and I use QMT to show only the animals that are available, the results page strips the term description (it still says “Posts classified under: Jill”, but the description with Jill’s email is gone). Also, a bunch of widgets appear in the sidebar that are not supposed to show on either taxonomy pages OR search pages, and the QMT widget disappears (it is set only to show on taxonomy pages).

    My two questions are:
    1) What is happening to the term description?
    2) If the results page that QMT is showing me is not a taxonomy page or a search page, then what is it?? I need a conditional to control what widgets do and do not appear in there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • 1) What is happening to the term description?

    Please paste the code you are using to display it.

    2) If the results page that QMT is showing me is not a taxonomy page or a search page, then what is it?? I need a conditional to control what widgets do and do not appear in there.

    It’s a taxonomy page, but is_tax('status') doesn’t work anymore.

    You can use is_multitax( array('status') ) instead.

    Thread Starter Seijun

    (@seijun)

    Would just plain is_multitax() work for both all muti tax and single tax pages, or does my conditional also need to include is_tax for single tax pages?

    Here is the code for my description. I got this from a tutorial on making tax archive pages. Sorry if the answer is obvious, I don’t really know any php.

    <?php
    if ( tag_description() !== '' ) { ?>
    <?php echo tag_description(); ?>
    <?php } ?>

    Would just plain is_multitax() work for both all muti tax and single tax pages, or does my conditional also need to include is_tax for single tax pages?

    I would write is_tax() or is_multitax(), just to be on the safe side.

    Here is the code for my description. I got this from a tutorial on making tax archive pages. Sorry if the answer is obvious, I don’t really know any php.

    That if condition is useless. This should work:

    <?php
    $term = get_term_by( 'slug', get_query_var('tag'), 'post_tag' );
    if ( $term )
      echo term_description( $term->term_id, 'post_tag' );
    ?>

    ‘post_tag’ is the taxonomy and ‘tag’ is the query variable for that taxonomy. Most of the times, they will be identical.

    Thread Starter Seijun

    (@seijun)

    <?php
    $term = get_term_by( 'slug', get_query_var('tag'), 'post_tag' );
    if ( $term )
      echo term_description( $term->term_id, 'post_tag' );
    ?>

    Did not work. Neither did these variations:

    <?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>

    <?php
    $termDescription = term_description( '', get_query_var( 'taxonomy' ) );
    if($termDescription != '') : ?>
    <div class="tag-desc"><?php echo $termDescription; ?></div>
    <?php endif; ?>
    <?php
    $termdescription = term_description();
    if ( ! empty( $termdescription ) )
    echo '' . $termdescription . '';
    ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Query Multiple Taxonomies] Loosing stuff on results page’ is closed to new replies.