Hi, Please help.
<?php
$args = array(
'post_type' => 'post',
'numberposts' => -1,
'orderby' => 'title',
'order' => 'ASC'
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) { while ( $query->have_posts() ) : $query->the_post(); ?>
<p><?php echo get_field('region'); ?></p>
<?php endwhile; } ?>
This code is types a list of ALL region field’s values
I need a UNIQUE list of field values
Hi @vivosystems,
Thanks for the post.
I would recommend you store all the values from the get_field() call in an array and then use the array_unique() function to filter the results and remove the duplicates.
Here is more info on this function: http://php.net/manual/en/function.array-unique.php