categories – hidden_empty property not working when using get_terms

i want to show All Including categories to which no post has been assigned.

So I came to know about ‘hide_empty’ property. Here is my code:

    $args = array(
        'taxonomy' => 'category',
        'hide_empty' => false
    foreach( get_terms( $args ) as $category ) {
        echo '<p>' . $category->name . '</p>';

But still only non-empty ranges are shown. What am I missing? My WP version is 4.8.

Thanks for the help!

Leave a Comment