我试图在我的页面上显示类别名称,但它没有显示。我正在使用下面的代码,并添加了短代码gridCategories
在我的页面上。我只得到array
function createGridCategories(){
$categories = get_categories( array(
\'taxonomy\' => \'category\',
\'orderby\' => \'name\',
\'parent\' => 0,
\'hide_empty\' => 0, // change to 1 to hide categores not having a single post
) );
var_dump($categories);
return $categories;
}
add_shortcode( \'gridCategories\', \'createGridCategories\');
我也试过了$categories = get_the_category();
var_dump($categories);
我在textblock中添加了这样的短代码