Can I use single_cat_title outside The Loop? (2 posts)

  1. reemer
    Posted 8 years ago #

    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?

  2. reemer
    Posted 8 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic