I have a repeater field in a site options page, which I am using to show content in posts according to category.
I am attempting to show a div ONLY if the date (real time) falls on or between two dates (start_date and end_date) set in a pair of sub fields within that repeater. The repeater field options (see attached screenshots) specify when it should be shown, filtered by:
Post category (checkbox sub field)
Start date (date picker sub_field)
End date (date picker sub field)
For this I need to be able to query the rows within the repeater for these variables. Here’s what I have attempted but so far not with any success. The category-specific part of the code works fine, but once the date-specific code is added nothing is returned.
I’ve based my code on this article and on this thread. I realise the two if conditionals (for category and date) should be combined into a single query but I haven’t been able to do this without the whole page going down.