Assign a Class to the Current “Tag” for Formatting

Add something like this to the functions file:

function current_tag($tags) {
    global $wp_query;
    $cid = $wp_query->query_vars['cat'];
    foreach($tags as $tag) {
        // match tagid to $cid
    }
} 
add_filter( 'get_the_tags', 'current_tag');

This won’t work by itself, but it will be a good start for getting the right information to the right place.

Leave a Comment