This thread is resolved. Here is a description of the problem and solution.
Problem:
Relevanssi results show in Toolset with items outside of designated Custom Post Type items
Solution:
There was a conflict with another theme or plugin.
- IMPORTANT STEP! Create a backup of your website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Toolset and Toolset add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.
I have a page with the list of products, the page shows all products which is correct. However, when I search for something with the text search input, it shows the other CPT's post title.
It's not clear what is been showing on the search page or the results page from the front end.
Would it be possible to get access to that site so we can check how this is set up?
Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.
What is the other CPT whose titles are being shown?
Would you please kindly follow the steps below to provide the debug information?
- Go to "WordPress Dashboard > WPML > Support > Debug Information (Link)".
- Copy the Debug Information from there.
- Get back to this chat screen and scroll down.
- Find the "Additional Data" section below. (Check the screenshot below)
- Click on the "Debug Info" item to expand it.
- Paste the debug information into the text area.
- Click the "Send Debug Info" button.
The post type is determined by the View settings, it's invariant, when Views constructs the query it takes the value for the post type from the View settings, it doesn't need to be "passed" the post type in any sense.
So if your View is returning results from a different post type that would indicate that something is interfering with the query being created by Views.
You can think of Views as a visual wrapper for the main WordPress WP_Query class which is used (by functions such as get_posts) to retrieve posts from the database.
If I had to guess I would say something is likely using the pre_get_posts hook to modify queries, and it isn't "watertight", it is indiscriminately altering any query rather than targeted queries, so it's affecting the query that Views build when it should have nothing to do with it.
That is why I suggest that you also do the test below and see if it has something to do with the interference I talked about:
- IMPORTANT STEP! Create a backup of your website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except Toolset and its add-ons.
- Check if you can still recreate the issue.
- If not, re-activate your plugins one by one and check the issue each time to find out the plugin that causes the problem.
Now to add a search, it only supports Text Fields and you need to have the test field assigned to the product in the field group and you need to enable the indexing option.