Joh*_*ohn 14 php wordpress plugins
$args = array(
"type" => "post",
"orderby" => "name",
"order" => "ASC");
$types = get_categories($args);
Run Code Online (Sandbox Code Playgroud)
执行此操作时.$ types仅包含"Uncategorized",因为它被用作我帖子的默认值.还有其他类别可用,但除非我有一个使用它们的帖子,否则不会返回它们.如何返回所有可能的类别而不仅仅是正在使用的类别?
coo*_*guy 31
<?php $args = array("hide_empty" => 0,
"type" => "post",
"orderby" => "name",
"order" => "ASC" );
$types = get_categories($args);
?>
Run Code Online (Sandbox Code Playgroud)