I’m trying to display the name of the category that a post lives in in single.php, but single_cat_title isn’t returning anything. I found somewhere that because it’s outside The Loop, I should add <?php $post = $wp_query->post; ?>. So I did, but still no dice.
Is this possible? What am I missing here?
- The topic ‘Can I use single_cat_title outside The Loop?’ is closed to new replies.