I want to display all categories including the ones with no posts assigned to it.
So I found out about the 'hide_empty' property. Here is my code:
<?php
$args = array(
'taxonomy' => 'category',
'hide_empty' => false
);
foreach( get_terms( $args ) as $category ) {
echo '<p>' . $category->name . '</p>';
}
?>
But still only the non-empty categories are shown. What am I missing? My WP version is 4.8.
Thanks for help!