• Hello,

    i am trying to show posts from 2 or more categories only. the code i have is:

    <?php $recent = new WP_Query('cat=$categoryid&orderby=title&order=asc&showposts=500'); while($recent->have_posts()) : $recent->the_post();?>

    basically i have it so that $categoryid is plugged in based on what category is assigned to it. so above it would be something like $categoryid=40 and then it would plug in 40 in there.

    my problem is that what if i want to show ONLY posts from category 40 AND 41?

    doing the 40,41 shows posts that belong either in 40 or 41 but i need it to show only posts that are IN 40 AND 41.

    wasn’t sure how to edit that code to start.

    thanks,

  • The topic ‘Help With Edit To Code To Show Multiple Categories’ is closed to new replies.