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.

I have two post types "restaurant" & "pub", they both share same custom taxonomy "country". And I display each post type in archive page.

What I want to do is, when I visit "restaurant" archive page, there is the taxonomy "country" terms listed as the menu in that page. The terms has to be from the posts that created in "restaurant" post type, so when user click on the terms (let say "US"), it will display the posts from "restaurant" that in "US".

Here is the illustration: enter image description here

Thanks

share|improve this question

1 Answer 1

Displaying two different menus base on the archive is no problem using is_post_type_archive()

What you are looking for is essentially the link to an term archive that only contains posts of a certain post type. Something like /index.php?term=US&post_type=pub. As far as I'm aware of WordPress doesn't offer this natively.

You will have to create your own page template and rewrite rules to make it display like /restaurants/fr. I think this questions covers enough about that: How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

share|improve this answer
    
It works, but it shows these error: Notice: Undefined property: stdClass::$labels in /wp-includes/general-template.php on line 665 Notice: Trying to get property of non-object in /wp-includes/general-template.php on line 665 –  dev-jim Aug 1 '12 at 15:39

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.