Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Taxonomy Dropdown Question WordPress

  • REFUNDED

Hi All,

I asked another question related to this - http://wpquestions.com/question/show/id/2144

But I have thought of another solution that would fix my problem.

I need to replace the show_option_all (which show all my taxonomies),

with:

a command to show three taxonomies (ID 14, 15, 16) and label this 'all'

Basically, when someone selects 'all' i only want to show the results of the three taxonomies above.

Note: i cant exclude the taxonomy from the search results as it will effect another search form.

Please help!

My current code is below:

<?php
//property types drop down
if (isset($_GET['property_types'])) { $category_ID = $_GET['property_types']; } else { $category_ID = 0; }
if ($category_ID > 0) {
//Do nothing
} else {
$category_ID = 0;
}
$dropdown_options = array (



'show_option_all' => __(get_option('woo_label_property_type_dropdown_view_all')),
'hide_empty' => 0,
'hierarchical' => 1,
'show_count' => 0,
'orderby' => 'name',
'name' => 'property_types',
'id' => 'property_types',
'taxonomy' => 'propertytype',

'exclude' => '',

'hide_if_empty' => 1,
'selected' => $category_ID,
'class' => 'last'

);











Answers (2)

2011-04-30

Peter Michael answers:

How do you use $dropdown_options ? Can we see the function which builds the dropdown?

2011-05-02

Khanh Cao answers:

How do you differentiate the search forms and their result pages?

On your desired search page, check if the cat id is '0' and change the query vars to include only those IDs.

To display a drop down that exclude those IDs out, it's better to create a new Walker class.