Support

Account

Home Forums Add-ons Repeater Field Query repeater field with two values Reply To: Query repeater field with two values

  • I am leaving a lot of stuff out because there’s way too much to paste here, but you get the idea.

    <?php
    $author = 85; //get_query_var('author');
    $images_query = new WP_Query([
        'suppress_filters' => FALSE,
        'posts_per_page' => -1,
        'post_type' => 'images',
        'meta_query' => [
            //'relation' => 'OR',
            //'relation' => 'AND',
            [
                'key' => 'authors_%_people',
                'compare' => 'LIKE',
                'value' => '"'.$author.'"',
            ],
        ],
    ]);
    ?>
    <div class="row grid">
    <?php
    if( $images_query->have_posts() ) :
    while( $images_query->have_posts() ) :
    $images_query->the_post();
    ?>
    <div id="<? the_ID() ?>" class="grid-item">
    <?= wp_get_attachment_image( get_field('image')['ID'] ?>
    </div>
    <?php
    endwhile;
    endif;
    wp_reset_query()
    ?>
    </div>