Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

As you can see from the image, I am listing all categories and the cities (taxonomy list).
enter image description here

What I want to do is :

If Car classifieds is selected on cities list show the city name which has car classified on that city. That means if 2 Car Classified is on London should show 'London (2)' (not total number). It is like filtering action.

I have something like

$cat_id = get_category(get_query_var('cat'))->slug; 
wp_list_cats( 'hide_empty=1&hierarchical=1&order=ASC&show_count=1&taxonomy=location&title_li=0&cat=$cat_id' );

Which doesnt work. I feel I am really close to solve this but couldnt manage to do it.

share|improve this question

1 Answer 1

I'm not hundred percent sure but I think the widget in scribu's plugin, Query Multiple Taxonomies, works exactly as you described. You can find plenty of resources on the subject on his blog.

This plugin lets you do faceted search using multiple custom taxonomies.

It has a drill-down widget with multiple display modes.

Said widget is easily customizable via template files (no PHP knowledge required).

share|improve this answer
    
i did make lots of researches but couldnt really find a solution and also trying to fix this without using any plugin at least.. thanks for info –  Emre Caglar Dec 4 '12 at 17:31
    
I didnt say yo have to use the plugin. you can simply check out the source code. The method what scribu originally used is in the core now because of him. The only thing Im not sure about ist the counter as you described but his widget does that. Check out the WP_Query docs for multiple taxonomy queries –  28inch Dec 4 '12 at 17:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.