Support

Account

Home Forums General Issues Can get_field be set with an array/multiple values? Reply To: Can get_field be set with an array/multiple values?

  • I forgot to add I’m trying to use a second value for “get_field(‘region’),” which should be an “or relation” if region is “online” or “learning center”.
    currently have this:

    <?php
            $today = current_time('Y-m-d');
            $args = array (
                  'meta_query'             => array(
                    'relation'    => 'AND',
                    array(
                      'category'         => 'events',
                        'key'       => 'end_date',
                        'value'     => $today,
                        'compare'   => '>=',
                        'type'      => 'DATE',
                        ),
                    array(
                        'key'   => 'region',
                        'value'   => get_field('region'),
                        'compare' => '='
                        ),
    
                    
                ),
                'meta_key'               => 'start_date',
                'orderby'                => 'meta_value',
                'order'                  => 'DSC',
                'posts_per_page' => 6,
                'category_name'         => 'events',
                'paged'         => 1,
    
            );