The following example shows how to request post from an specific category ID. It also show how to limit the number of results.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php $postslist = get_posts('numberposts=2&category=10'); foreach ($postslist as $post) : setup_postdata($post); ?> <div class="post"> <h3 class="post-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3> <div class="entry"> <?php the_excerpt(); ?> </div> </div> <div class="content_bottom"></div> <?php endforeach; ?> |