Tell us what you are trying to do?
I want to make a View (or an Archive, that would be fine too), combining two Post Types (Posts and Cases). And I want to make a custom search/filter, where visitors can select (multiple choice) which of these Post Types they want to show. In the future, I want to expand this with extra post types (Articles). So there is one page with all the content, instead of seperate pages with separate content.
Is there any documentation that you are following?
No
Is there a similar example that we can see?
No
What is the link to your site?
hidden link
Hello and thank you for contacting the Toolset support.
Currently, you can't filter a view by post type. But this feature will come in a near version of our plugin. We have currently a beta version, but it does not include this feature.
But, I think it can be done with some custom coding. A part of the custom code will add the post type filter control, and another part will hook into the query arguments and select which post types will be returned. Check these filters:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_end_filter_form
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
An archive template won't work in this case, except for a special case, such as taxonomy archive, where both post types use the same taxonomy.
I hope this answers your request. Let me know if you have any questions.
All right, I think I have to change some things. I think it's smarter to limit my Post Types and work more with taxonomies.
Then I have one Question left: Is it possible to assign a Template (and corresponding Forms) to a Taxonomy? Because when I go to a current template I can only select the 'main'-taxonomy (e.g. 'Categories') to use the template, but not a specific Category (e.g. 'Articles'), because I would like to make different templates for different categories.
In my case Articles, Blogs and Cases would be my categories for the Post Type 'Posts', but I would like to have different templates for each of the categories. Is this possible? And how do I make this happen?
Currently, there is no way to assign a content template per taxonomy term. To work around it, you will need to create custom code, that can hook into the template assignment and change it based on the current taxonomy term. You can try with the wpv_filter_force_wordpress_archive for archive templates.
https://toolset.com/documentation/user-guides/views-filters/#wpv_filter_force_wordpress_archive