[Resolved] Split: Conditional display for the date field not working as expected
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.
2. The "ort" custom field is of type select and not a date/time type field. For date function comparisons, only the date/time fields or the fields which are storing the raw UNIX timestamp format should be used.
So, based on these the correct format to use for the current post's field with slug 'example-field' would be:
[wpv-conditional if="( $(wpcf-example-field) lte 'NOW()' )"]
The condition is true!
[/wpv-conditional]
😉 - no i would hide any posts which is in future - lower or same like Now(). The Field "datum-und-uhrzeit" has a date which i can use it in an if-loop 😉 - but it dont work.
Since the 'datum-und-uhrzeit' field is directly attached to the post type 'Termine' that this view is showing, the shortcode for it doesn't need the 'item' attribute.
Yes, I've seen this page and it is not showing any results because there are no posts which are fulfilling the criteria.
To demonstrate that the conditional statement itself is working correctly, I've created a new test view named "Test view from TS support", with the same settings and it can be seen on a new page named "Test Page from TS support".
You can see that this page is correctly showing only the posts which have the 'datum-und-uhrzeit' field value, lower than or equal to 'Now'.
The reason the view with ID '12454' is not showing any results is that it is undergoing some extra filtering through the custom code snippet named "tssupp-multi-rfg-parents", added at WP Admin -> Toolset -> Settings -> Custom Code.
( screenshot: hidden link )
If you'll remove this view's ID '12454' from that code snippet, it will also start showing the results correctly.
yes you are right - now i ordering this view also about datum-und-uhrzeit: this is working - but now the filters wont work - do i see something wrong? -> look i filtered about kategories and date but nothing work.
As Toolset views, don't officially support the front-end search filters for the taxonomies and the custom fields attached to the related parent or child posts, this workaround of linking one view's results with another, can't be considered reliable or efficient.
A better approach, in this case, would be to use a single view that shows the "Veranstaltungen" posts with the desired search filters. And in the view's loop item template, you can show the related 'Termine' posts.