0

Is it possible to create a seperate widget for "Tags" and "TagsCloud"?

This question is similar, however how would you make 2 seperate widgets for "Tags" and "TagsCloud"? The difference is class would be called "tags" instead of "tagscloud" and the default settings for wp_tag_cloud() would have the same size no matter how many posts?

How do I display a tag cloud with both post tags AND a custom taxonomy?

0

we can create by category and we conver to custom category widget. There are a few plugins that are supposed to enable filtering tags for specific category. For example: TDO Tag Fixes and Sensitive Tags.

//Getting Tags for a Specific Category

<?php
    query_posts('cat=1&posts_per_page=-1');
    if(have_posts()): while (have_posts()) : the_post();
        $all_tag_objects = get_the_tags();
        if($all_tag_objects){
            foreach($all_tag_objects as $tag) {
                if($tag->count > 0) {$all_tag_ids[] = $tag -> term_id;}
            }
        }
    endwhile;endif;
    $tag_ids_unique = array_unique($all_tag_ids);

//Listing tags per category



     foreach($tag_ids_unique as $tag_id) {
            $post_tag = get_term( $tag_id, 'post_tag' );
            echo '<li><a href="'.get_tag_link($tag_id).'">'.$post_tag->name.' ( '.$post_tag->count.' )</a></li>';
        }?>

//Creating a tag cloud for a specific category



     wp_tag_cloud('include=' . implode(',', $tag_ids_unique));
  • How about "widgets reloaded" it fixes all of them? thanks for the answer though. – Josh Mar 30 '12 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.