I’m not sure where I got this information from now but here’s some code that I’ve used to create a page template with posts in it:
<?php
/*
Template Name: Samples
*/
?>
<?php get_header(); ?>
<?php $temp_query = $wp_query; // keeps page status intact when reversed below ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2 class="posttitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php edit_post_link(__('Edit'), '', ''); ?>
<div class="postentry">
<?php the_content("__('Read the rest of this entry »')
"); ?>
<?php wp_link_pages(); ?>
</div>
<?php endwhile; endif; ?>
<?php rewind_posts(); // repeat from here for multiple categories?>
<?php query_posts('category_name=sample1'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h2 class="posttitle" id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php endwhile; endif; // repeat section end ?>
<?php $wp_query = $temp_query; // returning the 'page' status?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
The first section is the ‘page’ part with any text you might want to write to introduce the posts in the category below. Then just copy and paste the repeat section any number of times with different categories named. The page status stuff I found I needed in order for the sidebar code to realise it was a page rather than a post, however if you are using PHP5 rather than PHP4, as I am, on your server you’ll need to change
<?php $temp_query = $wp_query; ?>
to
<?php $temp_query = clone $wp_query; ?>
This goes in your theme folder (with adjustments I imagine) and you’ll choose Samples as you template when creating the page.
PS I’ve never tried to post code before so hopefully it hasn’t got munged. If you use a text editor like Notepad2 – https://www.flos-freeware.ch/notepad2.html – the colours should make it a lot clearer if you save this to a textfile named eg samples.php