WordPress.org

Ready to get started?Download WordPress

Forums

What's wrong with this query? (3 posts)

  1. cam_oai
    Member
    Posted 8 years ago #

    I found this code for query posts from many cats, but some how it's only display 5posts. I have changed to 10 but still only 5posts..

    Can any1 tell me how to query to get posts from cat 2,3,4,5,6 ect

    NOT WORKING CODE HERE:

    <?php
    $posts = query_posts('cat=3,4,5,6,7,8&numberposts=6');
    foreach ($posts as $post) :
    ?>
    <div class="Box"><a href="<?php the_permalink(); ?>" title="<?php the_title() ?>"><?php the_title() ?></a><small><?php the_time('F jS, Y') ?></small></div>
    <?php
    endforeach;
    ?>

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    Try this instead:
    $posts = query_posts('cat=3,4,5,6,7,8&showposts=6');

    The keyword is "showposts". Not "numberposts".

  3. cam_oai
    Member
    Posted 8 years ago #

    thank you :), i never figure it out that part hehe.

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Topic