WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP_Query with Custom Taxonomy (2 posts)

  1. samanime
    Member
    Posted 3 years ago #

    I'm trying to use WP_Query to get all of a custom post type which contains a specific custom taxonomy.

    I've tried the new and old styles and I can't give it to give me what I want. It seems to basically be ignoring it completely, only using the post_type.

    I've tried:

    array('post_type' => 'my_type', 'tax_query' => array(
    				'taxonomy' => 'my_taxon',
    				'field' => 'slug',
    				'terms' => 'my_slug',
    				'operator' => 'IN');

    array('my_taxon' => 'my_slug', 'post_type' => 'my_type')

    and a few more. It just gives me all of the posts in that post type, not limiting them by the taxonomy.

    Any ideas?

  2. samanime
    Member
    Posted 3 years ago #

    Nevermind, I figured it out. I needed to have an array within my array for tax_query. =p

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.