Forums › Forums › Search & Filter Pro › Displaying no results for mixed content type search?
- This topic has 19 replies, 2 voices, and was last updated 4 years, 2 months ago by
Trevor.
-
Anonymous(Private) December 7, 2020 at 7:35 pm #269024
I have a related items section on these pages, been using a shortcode to display results using tagged custom post type (Projects) to set up Related Items filters for each Issues page. Example at the bottom of the page here:
https://denverstreetspartnership.org/what-we-do/federal-boulevard
The related items on this page are all Projects tagged “Federal”.
Now the client wants to add a new content type (blog posts) tagged “Federal” to this related items section.
I’m searching all Projects and all Posts, and including all Projects tagged “Federal” and all posts tagged “Federal” (include: post_tag: federal and include: project_tag: federal are both set on the taxonomy tab).
When I try them separately it pulls the Posts tagged “Federal” just fine, and it pulls the Projects tagged “Federal” just fine, but when I try to combine both I end up with zero results.
I’ve got the Field Relationships set to “OR”.
Any ideas what’s going wrong here?
Trevor(Private) December 11, 2020 at 5:22 pm #269580Sorry for the delay. I see the issue. You are using includes on taxonomies to do this. The logic of ‘includes’ is that any results MUST include all terms included.
Posts cannot include project tags, and so will not show, and Projects cannot include post tags, and so will not show.
In effect, your includes rules are mutually exclusive.
Taxonomies should not (not that you have) be shared between different post types, so that is not a solution. The only way you can do as you want (pre-filter more than one post type) is to add a custom field that is applied to both Posts and Projects (you could use the free Advanced Custom Fields plugin to do this), and then use the Post Meta settings tab to set a ‘like’ rule to match the one term.
-
AuthorPosts