Skip Navigation

[Resolved] Post-relationship

This support ticket is created 5 years, 11 months 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by Christian Cox 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#825580
Screen Shot-11.png
Screen Shot-10.png
Screen Shot-09.png
Screen Shot-08.png
Screen Shot-07.png
Screen Shot-06.png
Screen Shot-05.png
Screen Shot-04.png
Screen Shot-03.png
Screen Shot-02.png
Screen Shot-01.png

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

#835378
related-query-filter.png

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.

#841043
Screen Shot 2018-05-07 at 3.08.34 pm.png

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,

#843423

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?

#855969

Yes, three is result (but it's show all flights).
I use this filter to show all flights for DXB destiation (Departure & Return flights)

#857981

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.