<?php query_posts(’showposts=1&cat=1′); while(have_posts()) : the_post(); ?> <ul> <li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3> <ul><li><?php the_content_limit(300); ?></li> </ul> </li> </ul> <?php endwhile; ?>
another solution for multiple categories
<?php
//get 5 recent posts for categories 14 and 9
$args=array(
'category__in' => array(14,9),
'showposts'=>5,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo '5 recent Posts';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
} //if ($my_query)
wp_reset_query(); // Restore global post data stomped by the_post().
?>
Advertisement


Posted by LayoutSeed on April 21, 2010 at 9:14 am
Pretty good post. I just came by your blog and wanted to say that I’ve really enjoyed reading your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!
Posted by Paul Rayden on February 1, 2012 at 4:23 am
I used the multiple categories script.., as add next page button?
help me please!