<?php $categories = get_categories(); ?>
<?php foreach($categories as $cat) : ?>
  <h2><?php echo $cat->cat_name ?></h2>

  <?php query_posts('category_name='.$cat->slug); ?>

<ul>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<li><a>"><?php the_title(); ?></a> </li>
    <?php endwhile; endif; ?>
  </ul>
<?php endforeach; ?>
Advertisements