/ Published in: PHP
the above url has some helpful parameters
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $my_query = new WP_Query('cat=3&showposts=1'); ?> <?php if ($my_query->have_posts()) : ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h3><?php the_title(); ?></h3> <div class="entry"> <?php the_content("Continue reading " . the_title('', '', false)); ?> </div> <?php comments_template(); ?> <?php endwhile; ?> <div class="navigation"> <div class="left"><?php previous_post_link('« Previous Posts'); ?></div> <div class="right"><?php previous_posts_link('Next Entries »') ?></div> </div> <?php else : ?> <h2 class="center">Not Found</h2> <p class="center">Sorry, but you are looking for something that isn't here.</p> <?php include (TEMPLATEPATH . "/searchform.php"); ?> <?php endif; ?>
URL: http://codex.wordpress.org/index.php?title=Template_Tags/query_posts§ion=11#Parameters