Home › Forums › Front-end Issues › acf show custom field on date range › Reply To: acf show custom field on date range
Hi Rich…
Since you want both comparisons to be true, you can include an “AND relation” within the query:
array(
'relation' => 'AND',
array(
'key' => 'offer_start_date',
'value' => $today,
'compare' => '<='
),
array(
'key' => 'offer_end_date',
'value' => $today,
'compare' => '>='
)
)
Also, here are more docs on date queries that may be useful.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.