get_categories – hide_empty=0 not displaying categories that are empty
-
Hello. I am trying to make a check box with categories for users adding content from the front end.
<?php $categories = get_categories(array('orderby'=>'name','parent'=>3,'hide_empty'=>0)); foreach($categories as $categories){ ?> <input name="categories" type="checkbox" value="<?php echo $categories->cat_ID; ?>" /><?php echo $categories->name; ?><br /> <?php } ?>
I am currently using this to create the checkbox.
It works fine, except for the fact that the checkboxes are only displaying for categories that have existing posts.
I am using the hide_empty to display the empty categories, but it does not seem to be working.
Am I missing something within in the provided code?
thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_categories – hide_empty=0 not displaying categories that are empty’ is closed to new replies.