Read Make your own basic WordPress theme from scratch: Part 1.

Starting from where we left off in Part 1, you should now have the most basic WordPress template working showing a selection of your posts on the first page. First we’re going to make a few changes to our post query loop.

Instead of showing the entire post’s contents on the first page, we only want to show the excerpt. The excerpt can be used as an optional summary or description of a post but you can use it however you like. To edit your post’s excerpt you may have to select it from the Screen Options menu inside the Edit Post page from your site’s administrative portal.

We will also be turning our post’s title into a link to its own page. Take a look at Part 1 if you’d like to review changes or know more about what’s going on in the following code.

<? php
get_header();
query_posts('cat5&order=ASC&showposts=7');
if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?> </a>
<?php the_excerpt();
endwhile; endif;
get_footer();
?>

To allow for individual posts to have their own page, we will need to create a file called single.php in our template’s directory. This page will be used to display all single posts on their own page. Using the the_permalink() function within ‘The Loop’ will always take us to this page and dynamically generate the content from the post from which the URL was derived.

The following code is a simple single.php page showing the post’s title and content.

<? php
get_header();
The_post();
The_title();
The_content();
get_footer();
?>