Well, I tried something a little different and got the following error for the News Category, but the Articles Category worked fine:
WordPress database error: [Not unique table/alias: ‘wp_post2cat’]
SELECT DISTINCT * FROM wp_posts LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) LEFT JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE 1=1 AND (category_id = 4) AND post_date_gmt <= ‘2005-07-08 03:27:59’ AND (post_status = “publish” OR post_author = 1 AND post_status != ‘draft’ AND post_status != ‘static’) AND (category_id = 1) GROUP BY wp_posts.ID ORDER BY post_title ASC LIMIT 0, 2
This is what I did:
<p class="title">News</p>
<p />
<?php $top_query = new WP_Query('cat=4&showposts=2'); ?>
<?php while($top_query->have_posts()) : $top_query->the_post(); ?>
<div class="post">
<div class="post-info"><h2 class="post-title"><a href="<?php
the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php
the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
<div class="post-content">
<?php the_content(); ?>
<div class="post-info">
<p class="post-date">Posted on <?php the_time('D j M Y'); ?> <?php
edit_post_link('(edit this)'); ?></p>
<?php wp_link_pages(); ?>
</div>
<!--
<?php trackback_rdf(); ?>
-->
<div class="post-footer"> </div>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endwhile; ?>
<p class="title">Articles</p>
<p />
<?php query_posts('cat=1&showposts=2'); ?>
<?php while(have_posts()) : the_post(); ?>
<div class="post">
<div class="post-info"><h2 class="post-title"><a href="<?php
the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php
the_title(); ?>"><?php the_title(); ?></a></h2>
</div>
<div class="post-content">
<?php the_content(); ?>
<div class="post-info">
<p class="post-date">Posted on <?php the_time('D j M Y'); ?> <?php
edit_post_link('(edit this)'); ?></p>
<?php wp_link_pages(); ?>
</div>
<!--
<?php trackback_rdf(); ?>
-->
<div class="post-footer"> </div>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
</div>
<?php endwhile; ?>
I also noticed that when I added posts from the News category, they didn’t display on the index page, only posts from the Articles category show up. Thanks in advance for your help.