I am trying to display the categories name on my page but it's not displaying. I am using the below code and I added the shortcode gridCategories
on my page. I am getting only 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');
I tried this also
$categories = get_the_category();
var_dump($categories);
I added a shortcode like this in textblock
But still, I am not getting any output on my page. Is there any issue with my code?