Add Category Title Above Content On Each Page(s) (4 posts)

  1. laptopmemo
    Posted 6 years ago #

    What I'm trying to figure out to do is add the category title to each category page.

    Say you go to the "Leaks" category, right now you don't see the words "Leaks" above all of the posts in that category. I'd like to add that PHP string to my iBlog2 template so it can be easier for users to browse the site.

    my blog is LaptopMemo.com

  2. Michael
    Forum Moderator
    Posted 6 years ago #

    this is a corresponding area from the default theme's archive.php:

    <?php /* If this is a category archive */ if (is_category()) { ?>
    		<h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2>

    <?php single_cat_title(); ?> will echo the category title.

    obviously, add this to category.php (or archive.php).

    btw: the default theme is always a useful source of inspiration, to find out 'how it is done'

  3. laptopmemo
    Posted 6 years ago #

    Thanks but I don't have a category.php file. From what I know of, copying the index.php file and calling it category.php is enough, right? And I do have an archive.php, but would thay show any changes in categories?

  4. Michael
    Forum Moderator
    Posted 6 years ago #

    this might answer yuor question:

Topic Closed

This topic has been closed to new replies.

About this Topic