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>');
    }
?>

1 Answer
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>'); 
    }
?>

Leave a Reply

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