[Resolved] Searching two different post types on separate pages
This thread is resolved. Here is a description of the problem and solution.
Problem:
Searching two different post types on separate pages using one view Solution:
You can use the Toolset block/view's filter hook "wpv_filter_query" to change post type on fly.
Hi we have a website which has both the toolset blocks and views, with a search page enabled.
Currently what we're trying to do is have two separate search pages, each returning a different post type. For simplicity I'll call them post type A and post type B.
I've copied the search forms views into the two separate pages, however when I choose to filter the search results by a certain post type, this affects both pages.
Is there any way to have two separate pages with a search form on each returning results for 'post type A' on one page and 'post type B' on another?
Hello. Thank you for contacting the Toolset support.
It seems you have set your view to query two post types (A and B). And then you have a search form and you want to filter your post by post type and also want to display that on different search result page.
- Please correct me if I misunderstood your issue.
Normally, with the custom search view, you can have only one search result page but lets see and analyse your requirement first.
I would like to first see how exactly you setup your view and configured the search result page. Also, if you can share a test case that should explain what you want to display with different search result page that would help me to guide you in the right direction.
For that, I will require link of the page where you added your search form as well as where you configured the search results page and access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.