wordpress snippets last updated   : January 29, 2015
we now have 646 snippets

Add a custom class to the_tags

wordpress snippet

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

snippet :  PHPcopy
function add_class_the_tags($html){
    $postid = get_the_ID();
    $html = str_replace('<a','<a class="wpsnipp"',$html);
    return $html;

Did you like this post? If so please share it with your friends. Thanks!