• rhodesign

    (@rhodesign)


    Hi

    We run an Eventsite for a Concert-Location. We do that with a Custom-Post-Type “events” and the date-function from ACF. That works fine.

    We write a new Post (Event) and in there whe have a ACF Repeater-Field “artists” with the field “artistname” playing on this event.

    Now we want a new page with a list of all Artists (artistname) played at our club in the past. That list should display all Artisnames alphabetically.

    So the query should find
    1. past events – that works
    2. the repeater-field “artists” and give a list of artistnames.

    For Example
    Event one with Bandname A, Bandname Z
    Event two with Bandname B and Bandname X

    On the new Site we want a list like
    Bandname A
    Bandname B
    Bandname X
    Bandname Z

    My query_post so far

    <?php
    $today = date('Ymd');
    $args = array(
       'post_type' => 'events',
       'meta_key'  => 'date',
       'meta_value' => $today,
       'meta_compare' => '<',
       'posts_per_page' => '-1',
    
       'meta_query' => array(
            array(
                'meta_key' => 'artistname',
     	    'orderby' => 'meta_value',
     	    'order' => 'ASC',
            )
        )
    );
    query_posts( $args );
    ?>

  • The topic ‘Get list of Meta values from ACF Repeater-Field’ is closed to new replies.