• nadine00

    (@nadine00)


    Hi,

    I have a question. Currently I am using this code, which was hammered out for me a while ago by MichaelH.

    <?php
    $cat=get_cat_ID('Exhibitors');
    $catposts=get_posts('numberposts=999&order=ASC&cat='.$cat);
    if ($catposts) {
      foreach($catposts as $post) {
        setup_postdata($post); ?>

    It works awesomely, however, I am trying to mod it so that it pulls posts filtered by two categories, not just one.

    So for example: a post will only show up on this page if it is in both, featured guests and kids. Currently i’ve been messing around with some syntax, but i get errors. Its probably a small fix, i’m just really new to PHP.

    Any suggestions would be really helpful.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filtering posts based on two categories’ is closed to new replies.