Forums › Forums › Search & Filter Pro › Results only show posts from one custom post types
Tagged: cpt, custom post types, relevanssi
- This topic has 7 replies, 2 voices, and was last updated 7 years, 2 months ago by Trevor.
-
Anonymous(Private) October 17, 2017 at 6:40 pm #136996
Hello!
We have changed so that Search and Filter should search for posts in two custom post types. But when I search it only finds results from one of the two custom post types. I have also tried to uncheck the option which enables Relevanssi but when I uncheck that option it shows no results at all.
If you follow this url http://foxdesign-staging.pixeltokig.se/sokresultat/?_sf_s=hls you can see that it finds one result for the custom post type called “Produkter” but it shows zero results for the custom post type called “Referenser” even though it exists posts which contain the word “hls” as you can see with this url http://foxdesign-staging.pixeltokig.se/vara-referenser?_sf_s=hls.
I was trying to disable the Relevanssi option but then it shows no results at all.
We want to show results from both “Referenser” and “Produkter” on this page http://foxdesign-staging.pixeltokig.se/sokresultat/?_sf_s=hls and would like to make the posts with a title which contains the search word come on top of the results with Relevanssi which seem to work on the other pages when it only search for one custom post type.
Thanks so much in advance!
Kind regards, Christoffer
Anonymous(Private) October 18, 2017 at 9:46 am #137089Also, when I uncheck the checkbox for Relevanssi search setting then I still get no results here http://foxdesign-staging.pixeltokig.se/sokresultat/?_sf_s=hls.
Thanks!
Trevor(Private) October 18, 2017 at 12:27 pm #137104I will answer these last two posts in turn, if that is OK?
Post #137087. When using a text search only, the results will still be pre-filtered and sorted according to the form settings, so it does matter.
Post #137089. You will get no results because a standard text box search looks only in standard posts and pages, not CPT’s, I believe.
Anonymous(Private) October 18, 2017 at 9:08 pm #137256Thanks for the great reply!
> Post #137087. When using a text search only, the results will still be pre-filtered and sorted according to the form settings, so it does matter.
I see! Thanks for the clarification!
> Post #137089. You will get no results because a standard text box search looks only in standard posts and pages, not CPT’s, I believe.
So Search and Filter text field search does not support custom post types? If we want to use a text field search with Search and Filter then we have to also install Relevanssi?
Thanks!
Trevor(Private) October 19, 2017 at 12:05 pm #137336S&F should search the CPTs. I do not understand why it is not. You can see it doing this in the Movies demo. All S&F Pro does is to tell the WordPress search to look in CPTs, and then hands the search off to WordPress to receive back an array of the post IDs that match. It the filters those based on rules you have set in the form settings.
If it is finding nothing when not using Relevanssi, then something is not right. Either WordPress has been told to ignore the CPTs (you can exclude a CPT from searches when you set them up), or something in the form settings is causing it, or the cache needs rebuilding after you switch off support for Relevanssi.
-
AuthorPosts