got myself in a bit of a pickle. I want to display posts on category.php from the categories 'latest news' and 'custom models' only. The other category, 'press releases' is shown in a separate column.
I've the following code - hashed together from misc articles I've read - but it's showing ALL the posts rather than just my 2 chosen categories.
Perhaps the easiest way would be to show all posts apart from 'press releases'...
Can anyone help?
<div id="rightColumn">
<h1>
<?php single_cat_title() ?>
</h1>
<?php $posts = get_posts('category=Latest News,Custom Models'); foreach($posts as $post) { ?>
<div class="newsListing">
<div class="imageContainer"><a href="<?php the_permalink(); ?>">
<?php
// Must be inside a loop.
if ( has_post_thumbnail() ) {
the_post_thumbnail('size-2');
}
else {
echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/shared/placeholder.jpg" />';
}
?>
</a></div>
<h2><a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a></h2>
<h3>
<?php the_time('F jS, Y') ?>
</h3>
<?php the_excerpt(); ?>
<p class="readMore"><a href="<?php the_permalink(); ?>">Read more</a></p>
<div class="clearBoth"></div>
</div>
<?php } ?>
<div class="clearBoth"></div>
<div id="nav-below" class="navigation">
<p class="floatRight">
<?php posts_nav_link('','< Recent entries','Older entries >'); ?>
</p>
<div class="clearBoth"></div>
</div>
</div>