Using loops and query_posts
-
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.
- The topic ‘Using loops and query_posts’ is closed to new replies.