How would I go about showing all the tags that are used in a certain category and just that category?
How would I go about showing all the tags that are used in a certain category and just that category?
Look at http://wordpress.org/extend/plugins/tdo-tag-fixes/
tag: tdo-tag-fixes
there are 2 different functions in here. not perfect. will leave trailing commas and write duplicates if there are any. It's a start.
<!-- here -->
<div>
<ul>
<?php
// this will build a list of all categories and then all posts in them and list all tags used in each post
foreach (get_categories(array('hide_empty'=>true)) as $category)
{
$catid = $category->cat_ID;
global $post;
$myposts = get_posts('category='.$catid);
echo '<li>' . $category->cat_name . "\n";
echo '<ul>' . "\n";
foreach($myposts as $post) {
echo '<li>';
foreach(get_the_tags($post->ID) as $tag) {
echo $tag->name . ', ';
}
echo '</li>' . "\n";
}
echo '</ul>' . "\n";
echo '</li>' . "\n";
}
?>
</ul>
<ul>
<?php
// a specific category
global $post;
$myposts = get_posts('category=wordpress');
echo '<li>' . $category->cat_name . "\n";
echo '<ul>' . "\n";
foreach($myposts as $post) {
echo '<li>';
foreach(get_the_tags($post->ID) as $tag) {
echo $tag->name . ', ';
}
echo '</li>' . "\n";
}
echo '</ul>' . "\n";
echo '</li>' . "\n";
?>
</ul>
</div>
<!-- here -->You must log in to post.