Home › Forums › Backend Issues (wp-admin) › Post Object not resetting with wp_reset_postdata() › Reply To: Post Object not resetting with wp_reset_postdata()
I just ran into the same issue as truheart. However, I utilized WP_Query in my loop to call my custom post type. My code is similar to:
$args = array( 'post_type' => 'customposttype' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
In this case, I found the way to reset the post data was to run:
$loop->reset_postdata();
instead of wp_reset_postdata();
(due to the fact I have no global $post object defined).
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.