Support

Account

Home Forums General Issues Post Object, not consistent… Reply To: Post Object, not consistent…

  • Hi @brotsky_pixie

    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 🙂