I want to search for an anniversary within a certain time period. This code used to work, but it was updated to either PHP or WP, but now it returns 0 results. What’s wrong?
$posts = get_posts(
array(
'numberposts' => 8,
'post_type' => 'post',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'evfordulo',
'compare' => '>=',
'value' => '[0-9]{4}'.date('md',strtotime("-10 days"))
),
array(
'key' => 'evfordulo',
'compare' => '<=',
'value' => '[0-9]{4}'.date('md',strtotime("+10 days"))
),
),
)
);
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.