WordPress.org

Ready to get started?Download WordPress

Forums

How to find selected category name ? (2 posts)

  1. lstelie
    Member
    Posted 9 years ago #

    Hello,
    I'd like to add to my theme a category.php page used when a specific category is selected for display.
    I'd like to have at the top of the page something like
    "these are the posts in the category CATEGORY_NAME"
    $the_category() returns the category a specifi post belongs to but its seem to need to be inside the
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    What I would need is something like
    these are the posts in the category <?php the_global_category(','); ?> category
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    Is it possible and how ?
    Luc`

  2. lstelie
    Member
    Posted 9 years ago #

    Thanks a lot Beel
    it works !
    In case it could help the answer is
    "you will find below all my post in the category <?php single_cat_title('',true) ; ?>"
    "true" for diplaying the name
    Thanks again
    Luc

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.