Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8028351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:06:45+00:00 2026-06-05T00:06:45+00:00

I’m working on a site in which I need to query multiple terms in

  • 0

I’m working on a site in which I need to query multiple terms in a taxonomy. Currently, I have the follow which works with drop-down menus.

function ct_search_form_select_quick($name, $taxonomy_name = null) {
    global $search_values;

    if (!$taxonomy_name) {
        $taxonomy_name = $name;
    }
    ?>
    <select id="ct_<?php echo $name; ?>" name="ct_<?php echo $name; ?>">
        <option value="0"><?php _e('Any', 'theme_textdomain'); ?></option>
        <?php foreach( get_terms($taxonomy_name, 'hide_empty=0') as $t ) : ?>
            <?php if ($search_values[$name] == $t->slug) { $selected = 'selected="selected" '; } else { $selected = ''; } ?>
            <option <?php echo $selected; ?>value="<?php echo $t->slug; ?>"><?php echo $t->name; ?></option>
        <?php endforeach; ?>
    </select>

However, I want to be able to query multiple terms in a single taxonomy.

I have the following code which allows me to picks terms and outputs a the results for the first term, but ignores the second term. The URL is output as

?property_type=condo-duplex&property_type=condo-loft&ct_price_from=&ct_price_to=&ct_mls=&property-search=true&x=32&y=18, which needs to be output as ?property_type=condo-duplex,condo-loft&ct_price_from=&ct_price_to=&ct_mls=&property-search=true&x=32&y=18

function ct_search_form_select($name, $taxonomy_name = null) {
    global $search_values;

    if (!$taxonomy_name) {
        $taxonomy_name = $name;
    }
    ?>
        <input type="checkbox" value="0" name="ct_<?php echo $name; ?>"><?php _e('Any', 'theme_textdomain'); ?>
        <?php foreach( get_terms($taxonomy_name, 'hide_empty=0') as $t ) : ?>-->
                    <?php if ($search_values[$name] == $t->slug) { $selected = 'selected="selected" '; } else { $selected = ''; } ?>

<input type="checkbox" name="<?php echo $name; ?>" value="<?php echo $t->slug; ?>"><?php echo $t->name; ?>
        <?php endforeach; ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:06:47+00:00Added an answer on June 5, 2026 at 12:06 am

    How convenient for you:

    There is already an amazing plugin that achieves this exact functionality:

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

    See it in action here:

    productionlocations.com/locations

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
Thanks in advance for your help. I have a need within an application to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.