$args = array(
"type" => "post",
"orderby" => "name",
"order" => "ASC");
$types = get_categories($args);
When this is executed. $types only contains "Uncategorized" since it is used as the default to my posts. There are other categories available, but they are not returned unless I have a post that uses them. How can I return all possible categories and not just the ones that are in use?
<?php $args = array("hide_empty" => 0,
"type" => "post",
"orderby" => "name",
"order" => "ASC" );
$types = get_categories($args);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With