customising category pages (7 posts)

  1. joeking
    Posted 11 years ago #

    Is there a step by step guide to customising category pages?

    At the moment they look they same as my index page, but what I'd like to do is have diferent content in each category sidebar for example.

    Is this possible in v.1.5? And if so where do I start?

    Thank you!

  2. ohdear
    Posted 11 years ago #

  3. joeking
    Posted 11 years ago #

    Thanks ohdear,

    Could I ask where I put this - is it in index.php?

    And say for example I wanted a different header for category one. Could I create a file called category1header.php, upload it and then add:

    <?php if ((in_category('5'))): ?>
    <?php get_category1header(); ?>
    Some more category specific HTML here
    <?php endif; ?>

    Or doesn't it work like that?

    Sorry if I'm stating the obvious.

  4. joeking
    Posted 11 years ago #

    Mmmm - obviously not as simple as that.

    I tried it but got parse errors instead of my web page displayed.

  5. joeking
    Posted 11 years ago #

    anyone know how to get category pages that differ from the index page and each other?

    It is a great new feature, but hasn't been properly documented for newbies as far as I can see.

  6. Hannah S.
    Posted 11 years ago #

    What you're probably best off doing is making a new page for each category (next to the write option)... and then you can make them however you want. See that link about categories for how you'd set up the categories on each page...

  7. ohdear
    Posted 11 years ago #

    I think for category headers, the easiest option would be to make a file called category.php and place in your current theme folder.

    Then use <?php single_cat_title(); ?> to return the category title for page, e.g <h2><?php single_cat_title(); ?></h2>


    <img src="<?php bloginfo('url'); ?>/img/<?php single_cat_title(); ?>.gif" alt="<?php single_cat_title(); ?>" />

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.