Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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));
share|improve this answer
    
How about "widgets reloaded" it fixes all of them? thanks for the answer though. –  Josh Mar 30 '12 at 12:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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