get_the_category returns empty array
-
Hello. I’ve tried to set up a wordpress with the custom headers, based on current category selected. I am using permalinks and get_the_category within the following sample:
$cat = get_the_category();
print_r($cat);
$cat = $cat[0];
print(‘.’.$cat.’.’);
$cat=$cat->cat_ID;
print(‘.’.$cat.’.’);Returns:
.Array ( ) …
in every page.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_the_category returns empty array’ is closed to new replies.