I'm querying an ACF field, and displaying all the results on the front-end like so—
PHP:
<ul class="category-menu-items">
<?php
// args
$args = array(
'numberposts' => -1,
'post_type' => 'wpsc-product'
);
// get results
$the_query = new WP_Query( $args );
// The Loop
?>
<?php if( $the_query->have_posts() ): ?>
<ul class="inside-category-menu-items">
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li class="category-menu-item">
<a href="/shop/?view_type=default&product_search=<?php $remove = array(" ", ",", "/", ".", ":", "-", "–", "—", "!", "?", ";");
echo strtolower(str_replace($remove, "+", get_field('products_page_designer_name'))); ?>">
<?php the_field('products_page_designer_name'); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php wp_reset_query(); ?>
</ul>
This works great, the only problem is the values of some of the fields are duplicates of others, e.g. It will output a list like so:
Value 01
Value 02
Value 02
Value 03
Value 03
etc etc. but I only want to display one instance of each, thus if there's a duplicate value it will be hidden. Is this at all possible? Any suggestions would be greatly appreciated!