Support » Fixing WordPress » Display all tags for a category

Viewing 6 replies - 1 through 6 (of 6 total)
  • You will need a plugin for that. Not sure there is one yet.

    did you ever figure this out? I am trying to do this also

    Hi

    http://localhost/wordpress/?cat=12
    how to get the query parameter value “cat=3”?
    please help me.

    Thanks. Sai

    Hi, i’ve been looking for this for ages and i think i just found the solution.
    I’m only using wp_tag_cloud() which is already available in wordpress.
    I got the idea from http://wordpress.org/support/topic/238953?replies=1

    <?php
    
    //the id of the category you want
    $category_id = 4;
    
    $post_ids = get_objects_in_term( $category_id, 'category' );
    $tag_ids = wp_get_object_terms( (array) $post_ids, 'post_tag', array('fields' => 'ids') );
    $tag_param = '';
    if ( ! empty($tag_ids) ) {
    //change 'include=' to 'exclude=' to achieve the opposite..
    $tag_param = 'include=' . implode(',', (array) $tag_ids );
    }
    
    //format the output using wp_tag_cloud parameters
    wp_tag_cloud('number=0&amp;largest=12&amp;biggest=12&amp;unit=px&amp;format=list&amp;'.$tag_param);
    
    ?>

    the only thing missing is the post count in a bracket at the end of each tags..

    I’d like to try your solution, can you tell me where I would put that code?

    thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display all tags for a category’ is closed to new replies.