/ Published in: PHP

URL: http://www.wprecipes.com/get-tags-specific-to-a-particular-category-on-your-wordpress-blog
Most of this code is by: http://www.wprecipes.com/get-tags-specific-to-a-particular-category-on-your-wordpress-blog
I simply added the Tag Cloud
Expand |
Embed | Plain Text
query_posts('category_name=scribbles'); if (have_posts()) : while (have_posts()) : the_post(); $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $all_tags_arr[] = $tag -> term_id; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique } } endwhile; endif; foreach($tags_arr as $tag) { $includeTags = $tag.','; } wp_tag_cloud( $args );
Comments

You need to login to post a comment.
There is a mistake in line 14, the correct code is: $includeTags = $includeTags.','.$tag.','; since the other way it uses only the last tag.