• Resolved idesign123

    (@idesign123)


    I have the following code snippet…

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => 21,
    	'paged' => $paged
    );
    query_posts($args);
    if (have_posts()) :
    ?>

    This code works great – showing all the posts in category #21.

    I need to change it though…
    What I need now is to show posts from all categories EXCEPT categories #1 & 5.

    Can someone please show me what would need to be modified in my code to do this?

Viewing 1 replies (of 1 total)
  • Thread Starter idesign123

    (@idesign123)

    Hey, I figured out my own question 🙂

    Just change it to…
    ‘cat’ => -1,-5

    Hopefully that helps someone.

Viewing 1 replies (of 1 total)

The topic ‘Posts from all Categories except 2’ is closed to new replies.