I am trying to: view content for relationship between Destinations & Flight Schedules by using Custome Field Filter usind "code" field to customize flights depending to destination.
Link to a page where the issue can be seen: (see attachments)
I expected to see: spesific flights by specific destination.
Instead, I got: No items found
Hi, I can see that your Query Filter is set to a specific Flight Schedule, but no Flight Schedule is selected (see the attached screenshot). You must either select a specific Flight Schedule for a static View, or choose one of the variable options below it. For example, if you choose "The post with ID set by the shortcode attribute" then you can pass the Flight Schedule ID into the View using a shortcode attribute like this:
[wpv-view name="your-view-slug" wpvrelatedto="12345"]
Or like this on the Flight Schedule single post:
[wpv-view name="your-view-slug" wpvrelatedto="[wpv-post-id]"]
Also, I recommend you uncheck "Don't include current page in query result" unless you plan to place this View on a single Flight page. It can cause unexpected problems so if it's not necessary, I recommend you uncheck this box.
Thanks for reply,
But proplem is when i use another "Custom field filter" by selecting destiations code filed equal to any code like "DXB" the result shows "No items found". (see attachment)
Regards,
But proplem is when i use another "Custom field filter" by selecting destiations code filed equal to any code like "DXB" the result shows "No items found". (see attachment)
The attachment shows that there is still a Post Relationship filter applied. It should be deleted. If you get "no items found" before adding the custom field filter, then after you add a custom field filter the View will always return "no items found". The search filter uses "AND", not "OR", to combine clauses.
If you delete the Post Relationship filter, do you see the correct results?
Yes, three is result (but it's show all flights).
I use this filter to show all flights for DXB destiation (Departure & Return flights)
Okay, so the problem is not the custom field filter, the problem is the post relationship filter. See my comment here: https://toolset.com/forums/topic/post-relationship-7/#post-835378
You must add a Post Relationship filter and choose the option "Post with ID set by the shortcode attribute". Then use the shortcode attribute to pass in one of the Flight Schedule IDs, something like this:
[wpv-view name="your-view-slug" wpvrelatedto="12345"]
Change 12345 to be the numeric ID of one Flight Schedule.