filter via post_type + tax + term slug not working in 3.0? (4 posts)

  1. Anointed
    Posted 6 years ago #

    Here is a simple query that does not seem to work. For some reason the results are not filtering via the post_type. Results are turned for all post types that contain the taxonomy 'series' with the slug.

    $wpq = array (post_type =>'sermons','taxonomy'=>'series','term'=>$term->slug);
    $query = new WP_Query ($wpq);
    while ( have_posts()) : the_post(); ?>
    <?php the_title(); ?>
    do other stuff
    <?php endwhile; ?>

    Because I have multiple post types that use the taxonomy series, that also would have the same term applied, I am getting the output of both types, not just sermons.

    Is this a bug with 3.0, or a code error on my part?

    You can see the results at:

    Basically I am simply calling 2 loops with the above logic. The first query uses 'sermons' as post_type, the second uses 'podcasts' as post_type.

    However, both sermons and podcasts are being displayed in both queries.

    Should my function above not filter via the post type?

  2. Anointed
    Posted 6 years ago #

  3. MichaelH
    Posted 6 years ago #

  4. Anointed
    Posted 6 years ago #

    Thank you Michael
    Sorry about having posted it as a bug. IT just seemed like such simple logic that it had to be a bug in my code on my end. Now at least I know to quit banging my head into the same wall.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.