I have a post type "Exhibitions" which has two date fields: "Exhibition Viewing Start" and "Exhibition Viewing End".
I have three views set up:
Exhibitions Past:
Select items with field: Exhibition Viewing End is a NUMBER lower than TODAY()
Exhibitions Now Showing:
Select items with field: Exhibition Viewing End is a NUMBER greater than or equal TODAY()
AND
Exhibition Viewing Start is a NUMBER lower than or equal TODAY()
Exhibitions Coming Soon:
Select items with field:
Exhibition Viewing Start is a NUMBER greater than TODAY()
If you take a look at this page: hidden link you'll note there are three shows that should be under "Now Showing" but are under "Coming Soon" - check the dates listed beside "Viewing:"
Have I made an error in my logic in setting these up? Any idea why this doesn't appear to be working correctly?
Languages: English (English )Chinese (Simplified) (简体中文 )
Timezone: Asia/Hong_Kong (GMT+08:00)
Hello,
I have tried the URL you mentioned above, but I can see only one item under"Coming Soon", which is June 29, see screenshot Now-Showing.JPG.
I assume your custom date fields "Exhibition Viewing Start" and "Exhibition Viewing End" are using option: Input date and time.
If it is, I suggest you change the filter of view "Exhibitions Now Showing" as below:
Select items with field: Exhibition Viewing End is a NUMBER greater than or equal NOW()
AND
Exhibition Viewing Start is a NUMBER lower than or equal NOW()
No, they are just date fields- no time involved. Does that matter?
Yeah, sorry about that, the site is live and there's clearly some issue with it since there should be three shows under "Now showing" (compare what's listed there to what's on the homepage hidden link, they have the same filtering settings)
Languages: English (English )Chinese (Simplified) (简体中文 )
Timezone: Asia/Hong_Kong (GMT+08:00)
It does not matter, you just need to setup the filter for views as I mentioned above:
1) "Exhibitions Now Showing"
Exhibition Viewing Start<= now() <= Exhibition Viewing End
If the problem still persists, please try these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again
Languages: English (English )Chinese (Simplified) (简体中文 )
Timezone: Asia/Hong_Kong (GMT+08:00)
Here are what I found, the post view "Exhibitions Now Showing" does work, it can output three items of today's date June 20 2019, but you are using a conditional shortcode in this view, and conducts the problem, please try these:
Edit the post view "Exhibitions Now Showing": hidden link
In section "Loop Editor", add below line just after last [/wpv-conditional] tag, for example:
Your existed conditional shortcode can output results only when there are one or two results, above condition will be able to output results when there are three or more results.