• i have a query as below:

    query_posts(‘showposts=10&cat=67,3’);

    how can i exclude some posts? for example i dont want posts with id=6,12

    thanks 4 help

Viewing 2 replies - 1 through 2 (of 2 total)
  • just do -6,-12

    ^ Unfortunately that won’t work.

    query_posts('showposts=10&cat=67,3&p=-6,-12')

    WordPress doesn’t understand p=-6,-12 (yet).

    What you can do is…

    query_posts('showposts=10&cat=67,3');
    
    if(have_posts()) :
    while(have_posts())  : the_post();
    
    if (get_the_ID() != 6 && get_the_ID() != 12) {
        //display post goodies
    }
    
    endwhile; else:
    endif;
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to exclude some posts from query’ is closed to new replies.