//Put in header <?php global $post; $category = get_queried_object(); ?> //Put where you want to display the list <?php $args = array( 'taxonomy' => 'category', 'orderby' => 'name', 'order' => 'ASC' ); $cats = get_categories($args); foreach($cats as $cat) { ?> <a href="<?php echo get_category_link( $cat->term_id ) ?>/" class="<?php echo $cat->term_id == $category->term_id ? 'active' : null ; ?>"> <?php echo $cat->name; ?> </a> <?php } ?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter