get_terms not showing any results

Trying to display a list of all your wordpress categories or any other taxonomy, but no results are being displayed?

WordPress get_terms() function by default does not show any empty taxonomies.

get_terms not showing code snippet

To display all empty taxonomies with the function get_terms, set the ‘hide_empty’ argument to 0, as shown below.

// chosen taxonomy
$taxonomies = array( 'category' );
$args = array( 
	'hide_empty' => 0 
get_terms($taxonomies, $args);

Liked this article? help spread the word.