List terms of custom taxonomy if matches other taxonomy

Your approach isn’t bad, but instead of echoing all of these out, you should store them in an array, then use array_unique to remove duplicate entries before displaying. <?php $array_out = array(); while ($the_query->have_posts()) : $the_query->the_post(); ?> $terms = get_the_terms( $post->ID, ‘city’); foreach($terms as $term){ $term_link = get_term_link($term, ‘city’); $array_out[] = ‘<a href=”‘.$term_link.'”>’.$term->name.'</a>’; } endwhile; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)