Tell us what you are trying to do?
I want to have a single archive but be able to only display posts with a specific taxonomy type
Is there any documentation that you are following?
I have not seen specific up to date documentation
Is there a similar example that we can see?
I have a custom post of local-treat where I have local shops, eat and drink, places to stay. Some posts belong to more than one taxonomy type - e.g. a deli might also be a cafe. I only want one archive but I want to display it depending on a selection from a menu item so the user say selects places to eat and drink.
From what I have seen, it seems possible to build an archive specifying a taxonomy type but this seems over the top when the result will be the same other than the filter. I am hoping I have missed something very simple.
What is the link to your site?
haddington.info/index.php/local-treat
Thank you.
I don't entirely follow what you are describing, let's try and clarify that.
First, though, I'd suggest you check your permalink settings, its quite unusual to have an archive URL like haddington.info/index.php/local-treat instead of just haddington.info/local-treat
There are two main kinds of archives, both of which display posts.
There is the post type archive, which displays posts of that type. So your /local-treat archive would display local-treat posts. You can filter which local-treat posts to include in the output, e.g. to only show local treats with specified categories.
The second kind are called taxonomy archives, and there you display posts which have assigned the term specified in the url, e.g. site.com/colour/red/ would list posts that have the red colour category. You can also filter which posts appear, but you can't filter by colour: red posts will always be shown at this URL, not blue or green, but you can filter by other taxonomies or fields.
It sounds like you want the first kind? And you want to include category filters to users can choose "places to eat", "places to stay", or whatever your categories are.
Hi and thanks for responding. I want the results to be displayed for the user without their having to apply a filter. I believe this is the second option you have given (I have used the search option and category filters in other sections on the site)
I will go and look at permalink settings too to remove the index.php piece from the URL.
Do you have documentation for taxonomy archives - do I have to create different archive templates for each taxonomy term (I don't really want to do that as it is not easy to keep the archive templates in the same state once you start having to recreate them)