Home Forums Add-ons Repeater Field Problema withe repeater item Reply To: Problema withe repeater item

  • The problem is as I have explained in other places on these forums, and above. You cannot use a nested loop that includes setup_postdata() and wp_reset_postdata(). wp_reset_postdata() ALWAYS resets post data to the main query. In you example there is the “Main WP Query”, then you do a custom query, then you get a post from a field. The last is the 3rd nesting. Calling wp_reset_postdata() here is what is causing the problem. You must interact with this post in another way, for example

    <li class="inline-block">
        $post_object = get_sub_field('shop_sales');
        if ($post_object) {
            <a class="uppercase" href="territoiredhomme/nos-boutiques/">
              <?php echo get_the_title($post_object->ID); ?>