Posted By

daif on 02/24/11


Tagged

wordpress cloud tag


Versions (?)

Wordpress: Category Specific Tag Cloud


 / 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

  1. query_posts('category_name=scribbles');
  2. if (have_posts()) : while (have_posts()) : the_post();
  3. $posttags = get_the_tags();
  4. if ($posttags) {
  5. foreach($posttags as $tag) {
  6. $all_tags_arr[] = $tag -> term_id; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique
  7.  
  8. }
  9. }
  10. endwhile; endif;
  11.  
  12. $tags_arr = array_unique($all_tags_arr); //REMOVES DUPLICATES
  13. foreach($tags_arr as $tag) {
  14. $includeTags = $tag.',';
  15. }
  16. $args = array('include'=>$includeTags);
  17. wp_tag_cloud( $args );

Report this snippet  

You need to login to post a comment.