Posted by & filed under WordPress.

Adding this snippet to the functions.php of your WordPress theme will add a custom class to links output by the_tags template tag.

 

function add_class_the_tags($html){
    $postid = get_the_ID();
    $html = str_replace('<a','<a class="wpsnipp"',$html);
    return $html;
}
add_filter('the_tags','add_class_the_tags',10,1);

Leave a Reply

Your email address will not be published. Required fields are marked *