click category>>> then the posts i have created appear as a neat list, not like when you click a category your posts show up 1 after another with the content.
The display of category archives is controlled by Category Templates so if you were using the WordPress Default Theme you could create a template called category.php with this code:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
get_header(); ?>
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.
<?php get_search_form(); ?>
<?php endif; ?>
<?php
//}
?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Related:
Stepping Into Template Tags
Stepping Into Templates
Template Hierarchy
the_content()
the_title()
the_permalink()
thanks m8, very close, the posts show up in the middle and the category list is gone from the right to the left lol.
Well you’ll have to adjust/edit/add div’s based on your theme. Look at your theme’s index.php for ideas.
ok thanks, all looks ok for now, just not sure where in the Stylesheet (style.css) i have to add the background color for the new category template. im not sure off what the code would look like either, font and stuff are ok just not the page background in category template.
thanks, i think this is as far as i’ll get, apart from being a poor reader, i cant see why:
.category {
background: #FFF url(images/grad.gif) repeat-x;
}
is not working…
cheers.