• clarke1866

    (@clarke1866)


    Greetings,

    I’m messing around with the loop in WP and I’m trying to get some custom query’s working. Here is the basic query:

    if (have_posts()) : while (have_posts()) : the_post();
    // Do stuff like format each post etc
    endwhile;

    It works just fine. Here is the trick, how can I do the same exact query but instead of ‘doing stuff’ to every post, do stuff to every post except a post whose id is XX (whatever # I choose).

    In other words, how can I use query_posts (or any query, I dont’ care which function) to get and display all posts except one whose ID I specify?

    Is it posible to use something like !=$some_post_number where $some_post_number is already declared?

    Thanks for any help.

Viewing 16 replies (of 16 total)
  • Jay

    (@topdownjimmy)

    Is there any way to do this while only showing one post? In other words, I want to show only the most recent post that doesn’t have a particular post-ID.

Viewing 16 replies (of 16 total)
  • The topic ‘Using loops and query_posts’ is closed to new replies.