How to add custom taxonomy slug to default category slug
-
Hi everyone, I’m running a business directory site with pretty much default wordpress functions (default post type + default category). Since recently I’m in need for adding a city “filter” to my categories.
My default category is set to: /restaurants/chineese which shows all posts in subcategory chineese. I’d like to show a widget with a city “filter” which would return only chineese restaurants from New York. This would be easy achieveable with another subcategory: /restaurants/chineese/new-york but this is not an option since I have thousends of categories and I’d have to add hundreds of cities below every category.
I have created a hierarchical custom_taxonomy “Locations” with cities “new-york”… and the slug “/locations/new-york”. I have added 10 chineese restaurants to the city “new-york”. I was able to show a widget with the list of cities to which are the posts of current category added but the custom taxonomy link brings me to “/locations/new-york” where posts from all categories and city New York are listed – not only Chineese restaurants in New York.
My question:
Is it possible to add custom taxonomy slug at the end of category slug and show posts from the current category and the selected city.Example:
/category/subcategory/custom_taxonomy
(in my environment: /restaurants/chineese/new-york)Default category slug:
/restaurants/chineese should show all chineese restaurantsDefault category slug + Custom taxonomy slug:
/restaurants/chineese/new-york should show only chineese restaurants from New YorkI have used this thread to create the widget to show custom_taxonomy terms in the current category.
- The topic ‘How to add custom taxonomy slug to default category slug’ is closed to new replies.