WordPress.org

Ready to get started?Download WordPress

Forums

Exclude a category in my multiloop code? (2 posts)

  1. dsv
    Member
    Posted 8 years ago #

    I'm using the following code as the first part of my multiple loop layout. The first loop contains one post and the second displays the rest (sans the original post on top).

    $vposts = new WP_Query('showposts=1'); while ($vposts->have_posts()) : $vposts->the_post(); $do_not_duplicate = $post->ID;

    The problem is, I have an Asides category that I *want* in the second loop but not to be included in the first. I've added "&cat=-14" to the above query with no effect.

    Anyone have suggestions on how to accomplish this? Any help would be appreciated.

  2. MichaelH
    Member
    Posted 8 years ago #

    Just pointing to some info you might not have seen:
    The Loop
    The Loop in Action

    ********************
    Welcome to the WordPress Support Forums!

    Please help keep the Forums successful by reading:
    Using the Support Forums

    Also, remember the WordPress Codex and the FAQ pages.

    And, thank you, for letting us know if this information proves useful (or not)!
    ********************

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags