Plonk them in a theme file, save, view the page and view source…
wp_list_categories does add classes already, you can remove that from the ticket…
Not sure on tag_cloud, going to go dig in the files now and check..
EDIT: The tag cloud does add a class name to the list opening tag..
class="wp-tag-cloud"
or in CSS..
ul.wp-tag-cloud
However you can pass the tag_cloud into PHP as an array using ‘format=array&echo=0’
What you then do with it in PHP is up to you, so it’s possible to add your own classes using that..
I gave it a shot, and after a few searches i’ve realised the wp_tag_cloud function is not really helpful in determining the active tag…
However!.. i wrote this for you to add a tag class to LI elements, and an active tag class if a tag matches the current tag queried…
It may have been done before, or done better, but this works and is all yours to use if you want… 😉
<?php
// Grab tag cloud as array
$tag_cloud = wp_tag_cloud('format=array&echo=0');
// Set queried tag as variable (if one exists)
$active_tag = get_query_var('tag');
// Start a list
$showtags = '<ul>';
// Loop over each tag cloud array item
foreach($tag_cloud as $tag) {
// Check if there's a queried tag and if it matches the current array item
// Strip tags required because each item is inside linked elements
if($active_tag && ($active_tag == strip_tags($tag))) {
// Match, so create current tag item
$showtags .= '<li class="tag-current">'. $tag .'</li>';
}
else {
// No match, create regular item
$showtags .= '<li class="tag">'. $tag .'</li>';
}
}
// Close the list
$showtags .= '</ul>';
// Echo the end result
echo $showtags;
?>