Using get_the_category() in theme’s functions.php
-
I am trying to use get_the_category() in my theme’s functions.php file. When I print the array as seen below, I get an empty array. This code works just fine in the templates.
$category = get_the_category();
print_r($category);Is there a trick that enables the use of template tags in this file?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Using get_the_category() in theme’s functions.php’ is closed to new replies.