Adding a class to tag list in a function

How can I add a class to the function so I can style the output tags as boxes in css?

<?php
    if(get_the_tag_list()) {
        echo get_the_tag_list('<ul><li>','</li><li>','</li></ul>');
    }
?>

Related posts

1 comment

  1. If you are passing the before parameter that you can simply add any class that you want. You then style that class in style.css.

    <?php
        if ( get_the_tag_list() ) {
            echo get_the_tag_list('<ul class="tag-list"><li class="tag-item">','</li><li class="tag-item">','</li></ul>'); 
        }
    ?>
    

Comments are closed.