Finding and removing duplicates within WP Arrays
If you only want to collect the category+tag names into the output, you can try this <?php global $post; $words=array(); $tags = wp_get_post_tags($post->ID); foreach($tags as $tag){ $words[]=”%23″.$tag->name; } $cats = get_the_category($post->ID); foreach($cats as $cat){ $words[]=”%23″.$cat->name; } $words=array_unique($words); echo implode(” “,$words); ?>