Pull in the tags related to a category
<?php $project_query = query_posts('category_name=Real estate marketing'); while (have_posts()) : the_post(); $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $all_tags_arr[] = $tag -> name; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique } } endwhile; $tags_arr = array_unique($all_tags_arr); //REMOVES DUPLICATES foreach( $tags_arr as $tag ): $el = get_term_by('name', $tag, 'post_tag'); $arr[] = '"tag-'.$el->slug.'"'; ?> <span><a href="<?php echo bloginfo('url'); ?>/tag/<?php echo $el->slug; ?>" id="taglink-tag-<?php echo $el->slug; ?>" rel="tag-<?php echo $el->slug; ?>"><?php echo $el->name; ?></a> <span class="slash">, </span></span> <?php endforeach; ?>
Instructions:
This is a way to show all tags related to a category, without returning them in a list. This is a great way of adding more SEO, and kill some bounce rate.
Just make sure you change the name of your category where the category_name= starts. Use spaces if your category is named using more than one word.
Put this code where you want the tags to be displayed.