Home › Forums › General Issues › Issue with setup_postdata › Reply To: Issue with setup_postdata
The reason that it’s not working is that you’re not using get_template_part(). When you use get_template_part() WP declares the global $post variable for use in your template, along with many other global variables that are used in templates.
You either need to switch to get_template_part() or you need to declare the global variables yourself at the top of your file global $post;
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.