Speed up your Oxygen workflow

with Hydrogen Pack

A true Oxygens Editor Enhancer
Starts from $19.99

List categories and taxonomies with class active

List of categories for posts with link to archive and wrapped in classes

<ul>
    <?php wp_list_categories( array(
        'orderby'    => 'name',        
  		'title_li' => '',
        'hide_title_if_empty' => true,
    ) ); ?> 
</ul>

To enable it for taxonomies add this line and replace 'produckte' with your taxonomy slug

'taxonomy'  => 'produkte',

And on the end you will get this for custom categories ( taxonomies)

<ul>
    <?php wp_list_categories( array(
		'taxonomy'  => 'produkte',
        'orderby'    => 'name',        
  		'title_li' => '',
        'hide_title_if_empty' => true,
    ) ); ?> 
</ul>

Here is preview of HTML output:

<ul>
	<li class="cat-item cat-item-1 current-cat">
		<a aria-current="page" href="link">Cat name 1</a>
	</li>

	<li class="cat-item cat-item-2">
		<a aria-current="page" href="link">Cat name 2</a>
	</li>

	<li class="cat-item cat-item-3">
		<a aria-current="page" href="link">Cat name 3</a>
	</li>
</ul>

If you need help with custom scripts or you are not skilled enough to implement something from the tutorial?

HIRE ME

Stay up to date with latest post and updates.