I’ve got posts that are always associated with a single category (a country name).
I’m working outside the loop, and looking obtain the name of the related category for a given post’s ID number.
I don’t mind a SQL query, as it would match well with others I’ve got in play already.
The functionality would be the same result as these, which only yield results inside the loop:
$categoryArray = get_the_category(); $country = $categoryArray->cat_name;
- The topic ‘Single Category Title Outside The Loop’ is closed to new replies.