Support

Account

Home Forums Add-ons Repeater Field Post Objects in a Repeater

Unread

Post Objects in a Repeater

  • Hi. I’m having trouble to display post objects in a repeater. I think the problem is around the secound while loop. Someone has any Ideas?

    <?php if( have_rows('repeater') ): ?>
    <?php while( have_rows('repeater') ): the_row(); 
        // vars
        $repeater = get_sub_field('repeater'); ?>
        <?php $repeaterGroup = get_sub_field('repeater_group'); ?>
        <div class="box25-75">
            <div class="col col1">
                <?php $colLeft= $repeaterGroup['left_col']; ?>
                <div class="text">
                    <p class="text-center">
                        E: <a href="mailto:<?php echo $colLeft['email']; ?>"><?php echo $colLeft['email']; ?></a><br />
                        T: <?php echo $colLeft['telefon']; ?>
                    </p>
                </div>
            </div>
            <div class="col col2">
                <div style="margin-top: 40px;">
                    <?php
                      $args = array(
                        'post_type' => 'html5-blank',
                        'post_status' => 'publish',
                        'posts_per_page' => '100',
                      );
                      $wp_query = new WP_Query( $args );
                      if ( $wp_query->have_posts() ) : ?>
                            <?php while ( $wp_query->have_posts() ) : $wp_query->the_post();
                              // Set variables
                              $title = get_the_title();
                              $description = get_the_content(); 
                              $field = get_field_object('autor');
                              $colors = $field['value'];
                              $date = get_the_date( 'd.m.Y' );
                              // Output
                              ?>
                                <?php // show something ?>
                                <?php $wp_query->reset_postdata(); ?>
                            <?php endwhile; ?>
                        <?php endif; ?>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    <?php endwhile; ?>
    <?php endif; ?>
Viewing 1 post (of 1 total)

The topic ‘Post Objects in a Repeater’ is closed to new replies.