Taiyou
Forum Replies Created
Viewing 1 replies (of 1 total)
-
How come I tried for a whole week, and once posted here, I got an answer!
(Actually I’m just inspired by how to display category post only)What I did is still moving the link list part on top. Then make the query a new name. I’m not sure the reason, but I guess it is now not mixing up with the if loop of the individual post.
This is the final code I’m using. Just for any one facing the same problem. Thanks for reading ;p
<?php get_header(); ?> <div id="content" class="archivecolumn" role="main"> <!-- Category post list --> <?php $postList = new WP_Query(); $postList->query('cat=5&showposts=-1'); ?> <?php while ($postList->have_posts()) : $postList->the_post(); ?> <div align="left"> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br /> </div> <?php endwhile; ?> <!-- Category post list ends--> <!-- Display post, original from default single.php --> <?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; ?> <!-- Display post ends--> </div> <?php get_footer(); ?>
Viewing 1 replies (of 1 total)