Do you want to display a list of all the categories on your WordPress site? You can use this code to display a list of all the categories anywhere you want in your theme.

If you want to customize the look of this list, you might want to take a look at the reference for wp_list_cats function.

<div class='categories-list-wrapper'>
	<h2>All Categories</h2>
	<ul class='categories-list'>
		<?php echo wp_list_cats(array('orderby' => 'name')); ?>
	</ul>
</div>

The above code will create an unordered list of all the categories on your website.

Pin It on Pinterest

Share This