Adding active/current class to get_terms list
Run a conditional check in the foreach loop using is_category($term-name) Assign a class variable to active if it’s the same as $term->name $terms = get_terms( ‘category’ ); echo ‘<ul>’; foreach ( $terms as $term ) { $class = ( is_category( $term->name ) ) ? ‘active’ : ”; // assign this class if we’re on the … Read more