Home › Forums › Front-end Issues › Filtering posts by date with ACF datepicker. setup_postdata() not working › Reply To: Filtering posts by date with ACF datepicker. setup_postdata() not working
You cannot use the function the_title() and the_permalink(), or any other WP functions that start with “the_” in the loop your using. These only work inside a standard WP post loop while (have_posts())...
You need to use alternates like https://developer.wordpress.org/reference/functions/get_the_title/ and https://developer.wordpress.org/reference/functions/get_permalink/ that allow you to specify the post ID.
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.