WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Anointed
    Member
    Posted 4 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.

    <?php
    $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:
    http://deardaddy.org/series/unidos-messages/

    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
    Member
    Posted 4 years ago #


  3. MichaelH
    Member
    Posted 4 years ago #

  4. Anointed
    Member
    Posted 4 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

Tags

No tags yet.