WordPress Template Hacks
-
I am using this code for display the Tags inside one category
<?php
//get category name
$catname = get_category(get_query_var(‘cat’))->name;
//get all tags in this category
query_posts(“category_name=$catname”);
if (have_posts()) : while (have_posts()) : the_post();
$posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
//Get Tag ID
$all_tags_arr[] = $tag -> term_id;
}
}
endwhile; endif;
//remove duplicates
$tags_arr = array_unique($all_tags_arr);
?>I need 4 things:
1) How can I display these tags as DROPDOWN instead of Tags Clouds ?
2) How can I do the same but inverse: I mean display the Categories inside One tag, as DROPDOWN.
3) How to display 2 DROPDOWN , One with the All Categories and Second with the Tags inside this Category
4) On the search Results I need 2 DROPDOWN , in order people can filter the Search Results by Tags or by Categories.
Thanks in advance for your help , in any of those points.
- The topic ‘WordPress Template Hacks’ is closed to new replies.