Skip Navigation

[Resolved] Custom search not displaying all types of custom posts per category type

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a View that displays multiple post types. In that View, I have added a Query Filter that tests for a predefined value in a custom field, and I also have a Filter Control that lets Users select a taxonomy term. One post type never displays in the search results, despite havin

Solution: In this case, the Query Filter was set up using a custom field that was not present in one post type. Instead, a similar custom field was present in that post type, but used a different slug. Therefore the required custom field did not match the Query Filter, and none of the results from this post type would be displayed.

The solution is to use the same custom field in all post types. This may require placing the custom field in its own field group, so that it can be associated with all necessary post types.

This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by sharonb 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#595917
Screen Shot 2017-12-05 at 2.28.51 PM.png
Screen Shot 2017-12-05 at 2.28.21 PM.png
Screen Shot 2017-12-05 at 2.26.45 PM.png
Screen Shot 2017-12-05 at 2.13.08 PM.png

I am trying to: use a parametric search to filter 3 custom post types (set up as a custom taxonomy). I can get the correct number of custom posts to display when I filter by 1 post type (hidden link) but when I use the parametric search "Driving Parametric Vacancies Search" it only displays 3 driving posts when Driving is checked and no head office posts (there should be 1 custom post - hidden link)

Link to a page where the issue can be seen: hidden link

I expected to see: all posts displayed when the page loads

Instead, I got: only 4 driving posts and when I check driving it reduces to 3 and when I check Head Office I get no posts displayed (have I set it up wrong?)

#596064

Hi, this is the result of the closing date filter you have added to this View. The Head Office Career post type does not use the same date field, it uses something like "applications-close" instead of "closing date" - which I assume is applied to some other post type. When I edited this View's filters to try to pick a different field, I can see several custom fields that are similarly named. Some are "applications close" and others are "closing date", and there are even duplicates among those. So you need to be sure the correct one is selected here, and that it's the same for all 3 post types in this View. It's not a problem in the Driving Careers page View because the closing date filter is not applied.

If you need to share the same filter across multiple post types, it must be in a field group so it can be applied to all those post types. Otherwise, you will create multiple custom fields with different slugs. That will make filtering multiple post types quite difficult.

#596262

many Thanks! Can't believe I missed such an obvious mistake!!