Use the template tag, query_posts(), and the p=x argument.
Thanks Michael,
Not sure I am familiar enough to figure that out myself, are there any examples?
I think what I need to do is insert this snippet between my existing code to call from one category?
So:
<?php while (have_posts()): the_post(); ?>
<?php endwhile; ?>
would become
<?php while (have_posts()): the_post(); ?>
<?query_posts('cat=-3'); ?>
<?php endwhile; ?>
With the number 3 being replaced with my category name. Is this right?
It would be more like:
<?query_posts(‘cat=-3’); ?>
<?php while (have_posts()): the_post(); ?>
Thanks everyone, read the articles and used your code examples to accomplish what I needed!
Here’s what my final code looks like:
<div id="rightcol2">
<p><img src="../images/tipsheader.gif" width="204" height="37"></p>
<div class="item">
<?php if (have_posts()) : ?>
<?php $temp_query = $wp_query; ?>
<?php query_posts('category_name=tips&showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<small>
<?php the_time('F jS, Y') ?>
<!-- by <?php the_author() ?> -->
</small>
<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
</div>
It shows one post from the category “tips”. Awesome!!!
Just in case anyone cares, my head code reads like this:
<?php define('WP_USE_THEMES', false); get_header(); ?>
require('../wordpress/wp-blog-header.php');
query_posts('showposts=1');
?>
Thanks everyone!