1

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.

1 Answer 1

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).

2
  • 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 Commented Dec 4, 2012 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
    Commented Dec 4, 2012 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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