Home › Forums › Add-ons › Repeater Field › Show only start and end dates after today from repeater field › Reply To: Show only start and end dates after today from repeater field
I’ve updated this to have the SQL query take care of the date issues, so it’s now:
SELECT
A.post_id,
A.meta_value as startdate,
B.meta_value as enddate
FROM wac_n06_postmeta as A
JOIN wac_n06_postmeta as B on A.post_id
WHERE A.post_id = B.post_id
AND A.meta_value > CURDATE()
AND A.meta_key LIKE 'tour_dates_%_tour_start' AND B.meta_key LIKE 'tour_dates_%_tour_end'
AND SUBSTRING(B.meta_key,12,5) = SUBSTRING(A.meta_key,12,5)
But I still haven’t worked out how to make the matching bit less hacky.
Any help much appreciated!
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.