My below code prints duplicate terms of a venue.
if Venue is New York for 3 posts it will print new york 3 times. I want to print it only one time.

Can anyone tell me how can I achieve this ?

<?php 
$archive_data = get_queried_object();
//echo '<pre>';print_r( $archive_data );
$archiveId = $archive_data->term_id;
$categroy_name =  $archive_data->slug;
$subseminars_found = euromatech_search_subseminars( $archive_data->slug, '', '');  

if(!empty($subseminars_found)){
    foreach($subseminars_found as $month => $day){
        ?>


                    <?php

                    foreach($day as $subseminars){
                        foreach($subseminars as $subseminar) {
                            ?>

                            <h4 class="entry-title" ><a href="<?php the_permalink($subseminar['seminarID']); ?>">
                                       <?php echo esc_html($subseminar['venue']); ?></a></h4>

                            <?php
                        }
                    }

                    ?>



        <?php
    }

} else {

    echo '<h4>No Upcoming Seminars found</h4>';
        echo '<p>For further information on forthcoming events in this region, please contact <a href="mailto:',ot_get_option('email_address', ''),'">',ot_get_option('email_address', ''),'</a></p>';
} ?>

Read more here: Remove duplicate terms printed using a foreach loop


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: