Excerpt of posts on homepage

HI folks,

Can someone please tell me how I can display the content of my post up until the more tag, displayed on the homepage of my site?

I’ve read up on the loop and the excerpt, but I’m really struggling to understand how it works. Can someone please give me some sample code?

If I know the post id of my post, what do i need to add to home.php?

I cant even get any content to display using this code:

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>

can someone please help? I’m getting very desperate

Many thanks in advance

Something like this should work

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" 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
<div class="entry">
<?php the_exerpt(); ?>
</div><!-- end entry -->
</div><!-- end post -->
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>

Do you have multiple loops running on index.php?

If so, use a custom loop, e.g. something like this:

<?php
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
?>

<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?> // only works if you use the custom excerpt field

<?php endwhile; ?>