Home › Forums › General Issues › Post Object, not consistent… › Reply To: Post Object, not consistent…
You have multiple setup_postdata()
but only one wp_reset_query()
there. Could you please tell me what the $quote
variable is? Could you please share the JSON export file of the field group and the full code of the page? If the full code is too long, you can share it using https://gist.github.com/.
If you want to show nested post objects, I believe you need to do it like this:
<?php
$post_quote = get_field('associated_quote');
if( $post_quote ): ?>
<blockquote class="testimonial">
<?php
$post = $post_quote;
setup_postdata( $post );
the_title();
$quote = get_field('associated_quote');
$post = $quote;
setup_postdata( $quote );
the_title();
wp_reset_query();
?>
</blockquote>
<?php
wp_reset_query();
endif;
?>
I hope this helps. Thanks 🙂
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.