WordPress.org

Support

Support » How-To and Troubleshooting » get_posts – exclude one or more categories

get_posts – exclude one or more categories

  • Hi folks,

    I’ve searched about for answers to this but can’t find anything that works.

    How can I modify my query so that it exlucdes a particular category?

    <?php $posts = get_posts('numberposts=15'); foreach ($posts as $post) : ?>

    I can specify to show only one category, say numberposts=15&category=1, but the reverse, numberposts=15&category=-1 gives me an error.

    Confused!

    Thanks for your time

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_posts – exclude one or more categories’ is closed to new replies.
Skip to toolbar