Support » Themes and Templates » Can I use single_cat_title outside The Loop?

  • 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?

Viewing 1 replies (of 1 total)
  • hmm, did some more reading and found that a single page is inside The Loop… still no idea why single_cat_title isn’t returning anything.

    Anybody with an idea?

Viewing 1 replies (of 1 total)
  • The topic ‘Can I use single_cat_title outside The Loop?’ is closed to new replies.