I have a code that displays a list of categories of Custom post types. And since it is displayed on the sidebar of the Single post template. I want to also change the text color of the categories that are assigned to the current post. Is this possible?
I have the code
<?php
$args = array(
'taxonomy' => 'services',
'orderby' => 'name',
'order' => 'ASC'
);
$cats = get_categories($args);
foreach($cats as $cat) {
?>
<a href="<?php echo get_category_link( $cat->term_id ) ?>">
<?php echo $cat->name; ?>
</a><br>
<?php
}
?>
Change the text color of the categories that are assigned to the current post.