I have a list of terms I’m displaying using “get_terms”. Each term is linked so if the user clicks it, they go to the term archive page.
<?php $terms = get_terms('category');t
echo '<ul>';
foreach ($terms as $term) {
echo '<li><a href="'.get_term_link($term).'">'.$term->name.'</a></li>';
}
echo '</ul>';
?>
However, I would like to know if there’s a way to add an “active” class to each term link if user goes to the term archive page.
Thanks a lot for your help,