Forums

Display category name within category (5 posts)

  1. metalious
    Member
    Posted 5 years ago #

    Seems I should see what category I'm in after clicking on a category. Preferably, if I click on a category named Pets, it should have a subheader line that displays "Pets".
    No?
    Anyone know an easy way to make this happen?
    cheers
    Metalious

  2. gat
    Member
    Posted 5 years ago #

    put this code outside the wordpress loop, where you want the category name to appear:

    <?php
    if ($cat)
    {echo "<h2>Category: " . get_the_category_by_ID($cat) . "</h2>";}
    ?>

  3. metalious
    Member
    Posted 5 years ago #

    Thanks for the reply.
    I'm afraid I have no idea where to paste that code.
    I would like for the category name to appear directly below the header, logo etc..
    I'll experiment with pasting it into the index.php somewhere unless someone tells me not to bother.
    Also, can I assume that I can replace the CSS style "h2" with any other style?

  4. strom
    Member
    Posted 5 years ago #

    Any luck with this metalious?

  5. Cine
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.