function tag_options($type){ global $ctf_options, $current_tag; if(is_category){ $category = get_the_category(); $cat_ID = $category[0]->cat_ID; $args = array( 'cat' => $cat_ID ); query_posts($args); 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; $tags = array_unique($all_tag_ids); }else{ $tags = get_tags(); } if ($type == 1){ $options .= '