Home › Forums › Backend Issues (wp-admin) › Dynamically populating Select Field with CPT Posts › Reply To: Dynamically populating Select Field with CPT Posts
Hey, was looking at the forum and saw this…I think in the following code:
if ($the_query->have_posts()) {
global $post;
while( $the_query->have_posts() ){
You do not need:
global $post;
You are querying from here and going through the loop based on the results, you have the actual post data, no need to bring the global.
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.