WordPress.org

Forums

Query Multiple Taxonomies
[resolved] code for inserting form wiithout using widget (7 posts)

  1. Maitresinh
    Member
    Posted 4 years ago #

    hello

    i'd want to insert the plugin into the search page result, so i would need the code to to that.

    Help please ?

  2. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    You can use the_widget(), like so:

    the_widget('Taxonomy_Drill_Down_Widget', array(
    	'title' => '',
    	'mode' => 'dropdowns',
    	'taxonomies' => array( 'post_tag', 'color' ) // list of taxonomy names
    ));

    'mode' can be one of 'lists' or 'dropdowns'

  3. Maitresinh
    Member
    Posted 4 years ago #

    thanks.

    Sorry but as i'm a complete sucker in coding, i get the code as "text". where and how do i have to insert it (yes, i'm sorry..)

    here is the code in the search.php
    ---------
    <?php if (have_posts()) : ?>
    <div class="search-results">
    <h2><?php _e('Resultats', 'arras') ?></h2>
    <div class="search-results-content clearfix">
    <p><?php printf( __('Resultats pour ‘' . '%s' . '’</p>', 'arras'), wp_specialchars($s, 1) ) ?>
    <?php get_search_form(); ?>

    the_widget('Taxonomy_Drill_Down_Widget', array(
    'title' => '',
    'mode' => 'dropdowns',
    'taxonomies' => array( 'post_tag', 'color' ) // list of taxonomy names
    ));

    </div>
    </div>
    --------------

    the other problem is that it seems that the page resultat for QMT is NOT the search.php page. how can i insert the code in THIS page ?

  4. Maitresinh
    Member
    Posted 4 years ago #

    oups , sorry, i put <?php ...
    and it's ok.

    but i still wonder where is the page for the QMT results ?

  5. scribu
    Member
    Plugin Author

    Posted 4 years ago #

    You have to edit taxonomy.php (or create it if it's not there).

  6. Maitresinh
    Member
    Posted 4 years ago #

    thank you.

    i just duplicate the search.php of my theme folder and change the name into taxonomy.

    it seems to work so fa (no ?)

    the only problem is that i don't know how to change search result for xxxxxxxx and include the terms of query.

    Sorry, again.

  7. scribu
    Member
    Plugin Author

    Posted 4 years ago #

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