Support » Fixing WordPress » Custom category pages

  • Hi,

    I want to create custom category front pages that have the feeling of an index with only a couple of highlighted posts, with then a link to the rest of that categories archives.

    I’ve got 2 ideas of how I could do this:
    1) set up a page for each category, leaving the archive page as it is. I think this would would, but wouldn’t create a url structure
    2) use pagination to make page 1 customised and page 2 onward as normal archives (ie. just a list of post titles) I’m not sure this work..

    Any ideas?

    Thanks for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t really see hoe your solutions would work… but you can always take a look at the Category Templates 😉

    I’ve done this. I’ve written a script that dynamically selects a category-specific header image as well.

    If you’re comfortable with php, it’s a snap.

    In any case, use the archive template with a loop that looks something like this:

    <?php get_header(); ?>
    <div id="content" class="narrowcolumn">
    <?php if (have_posts()) : ?>
    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php if (is_category()) { ?><h2 class="red"><?php
    if (!in_category(1)) { echo single_cat_title(); } }?></h2>
    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post">
    <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <div class="entry">
    <?php the_content() ?>
    <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    <?php endwhile; ?>

    thanks I will give that a go 🙂

    also, to Moshu, I have looked at that page – its the sticky text section which made me wonder whether I could use the if ( $paged < 2 ) function. I just wasn’t sure whether that would work!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom category pages’ is closed to new replies.