Forums

Filtering posts based on two categories (3 posts)

  1. nadine00
    Member
    Posted 2 years ago #

    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.

  2. doronov
    Member
    Posted 2 years ago #

    Hello Nadine? did you fix it? I have the same question!

  3. alchymyth
    The Sweeper
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic