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