• i dont understand on my blog https://blogdopatu.ueuo.com/ i have made some kind of headlines for each category, if i use the function
    get_posts('category=1')
    this headline limits posts to 5, i want more, and if i use
    query_posts()
    it takes all categories, what i can do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • How about:

    <?php query_posts('showposts=10&cat=1'); ?>

    If you don’t want to ‘disturbe’ the original query:

    <?php
    //get 10 posts for category 1
    $type = 'post';
        $args=array(
          'category__in'=> array(1),
          'post_type' => $type,
          'posts_per_page'=>10,
          'caller_get_posts'=>1
        );
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          echo 'All ' . $type . '(s) with metakey '.$metakey;
          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().
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘function get_posts() limited’ is closed to new replies.