Support » Fixing WordPress » show number of posts from category

  • i am usign this code

    <ul class="list-1">
    									 global $post;
    									 $myposts = get_posts('posts_per_page=10&category=9');
    									 foreach($myposts as $post) :
                                          <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></li>
    									  <?php endforeach; ?>

    but it only returns 5 posts and not 10..

    Can someone help me ?

Viewing 1 replies (of 1 total)
  • ok.. found it – writing it for other’s

    <ul class="list-1">
    									<?php $recent = new WP_Query("cat=9&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
    									<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
    									<?php endwhile; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘show number of posts from category’ is closed to new replies.