Hello,
I'm now working on the single.php, try to make it having 2 parts. One for displaying all post's permalinks from category id "5", one for displaying the requested individual post, under the same category. With the code quote below, it only displays the link list, and the individual post not showing up. But if I move the "Category post list" part after the "Display post" part, it works. I tried to read the wordpress docs on templates and loops, but still not sure how to make it. Maybe I missed some important things? Thanks in advance for any kindness help.
<?php
get_header();
?>
<!-- Category post list -->
<?php query_posts('cat=5&showposts=-1'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div align="left">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
</div>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
<?php query_posts(); ?> <!-- I'm not sure is this necessary or not to clear the query -->
<!-- Category post list ends-->
<!-- Display post, original from default single.php -->
<div id="content" class="archivecolumn" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class="fontstyle9"><?php the_time('Y- n- j') ?></div><br />
<div class="entry">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
</div>
<?php get_footer(); ?>