Support

Account

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

Helping

Can get_field be set with an array/multiple values?

  • Such that instead of displaying a single value, which would be “my_value” make it so it can be more than one value.
    $value = get_field( “my_value” );

    maybe something like
    $value = get_field( array( ‘my_value’,’my_value2′));

  • 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,
    
            );
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Can get_field be set with an array/multiple values?’ is closed to new replies.