Can anyone advise the code I need, to have a page, that appears with the title of each category, and then list the posts contained withing the category, then another category with it's post etc..
So it looks a bit like this...
TITLE OF CATEGORY A
POST 1 CATEGORY A
POST 2 CATEGORY A
TITLE OF CATEGORY B
POST 1 CATEGORY B
POST 2 CATEGORY B
ETC ETC...
Can you advise on how to setup the loop for this? This is my current code - I think I just need to add the Category tag here some where, but I'm a bit stuck...
'<?php if (have_posts()) : ?>
<?php query_posts('showposts=20&cat=4,3'); $i = 1; ?>
<?php while (have_posts()) : the_post(); ?>
<!--" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
<small><?php the_time('F jS, Y') ?> </small>
-->
<h2><?php the_time('F Y') ?></h2>
<div class="mainNewsBlock">
<?php $values = get_post_custom_values("Image");
if (isset($values[0])) { ?>
" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
$values = get_post_custom_values("Image"); echo $values[0]; ?>&w=35&h=35&zc=1&q=35"
alt="<?php the_title(); ?>" class="left" width="35px" height="35px" />
<?php } ?>
" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?><?php the_excerpt(); ?>
</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.</p>
<?php get_search_form(); ?>
<?php endif; ?>
'
many thanks