WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to get it to list the Category name taken FROM the file? (3 posts)

  1. JuryDuty
    Member
    Posted 8 years ago #

    I've created a category-3.php to show my entry titles alphabetically whenever category 3 is accessed. But how can I force it to list a category title outside a loop?

    For instance, I want it to say:

    Category 3 <--taken from the category file
    Post 1
    Post 2
    Post 3

    Instead, it's showing:
    Category 3 <--Taken from the post
    Post 1
    Category 3
    Post 2
    Category 3
    Post 3

    Of course, it's doing that because it's in the loop, but outside the loop it shows up "uncategorized." Any ideas how to force it to list a category name within text?

    Here's what it's doing: http://www.masellis.com/?cat=3

  2. moshu
    Member
    Posted 8 years ago #

    Did you try to use the Template_Tags/single_cat_title tag?

  3. JuryDuty
    Member
    Posted 8 years ago #

    Yay! That's exactly what I needed. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags