You can do what you want with the tax_query
parameter since version 4.1, use EXISTS
as the operator parameter in your tax query.
$args = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'mytax',
'operator' => 'EXISTS'
),
),
);
$query = new WP_Query( $args );
Related Posts:
- Custom archive page based on array of categories and tags
- tax_query shows no results if nothing is selected
- Query Custom Post Type Order By Taxonomy Field
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Custom taxonomy.php not working
- list all post who have mutual taxonomy as current taxonomy!
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- Taxonomy Terms That Don’t Exist Display Results
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- WP_Query on custom taxonomy -> Location and Activity
- Include custom post type that matches taxonomy field in another custom post type
- WordPress tax_query “and” operator not functioning as desired
- Custom taxonomy query broken after upgrade to 4.4
- Show posts without term
- Custom Taxonomy and Tax_Query
- How to add taxonomy filter on the query fly?
- Display posts the match taxonomy term linked from wp_list_categoies?
- Query two taxonomies via URL or link?
- WP_query taxonomy + get all posts with two terms from same taxonomy
- Counting number of posts with Category B in Category A
- SQL Statement generated by WP_Query not producing expected results
- Select posts wich has no relationship in custom taxonomy
- List taxonomy terms plus their latest post ordered by post date
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Filter and list posts of a custom taxonomy
- Advanced Tax Query
- WP_Query use for a filter with multiple Taxonomies and Terms
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Improving WP_Query performance for multiple taxonomies
- get complex results set according to category structure
- How to Modify Taxonomy Archive Page with Search Parameter?
- Get array of current post term ID’s
- Paginated Taxonomy Term Archive including one post per term
- Setup of taxonomy term template pages
- Get image of latest post from taxonomies/categories
- Display link to taxonomy archive only if it has posts with certain custom field values
- How to do a query on custom taxonomies that is uncategorised?
- WP_Query, tax_query and term_meta: How to?
- Order taxonomy terms in alphabetical order
- Shortcode to show thumbnail and link for 3 random posts
- Query post from all category with same tag on 1 pages
- Query with custom taxonomy not working
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Advanced Query Logic With Multiple Taxonomies
- Function get_queried_object() return NULL in custom taxonomy
- Getting Taxonomy inside WP_Query Loop
- Order posts by taxonomy count
- showing all search result in one template
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Query custom post type by custom taxonomy (category slug)
- How to Filter Posts by Custom Fields?
- Show posts from a custom taxonomy on a page
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- WP_Query ignoring tax_query when is_singular
- How do I exclude the lowest level terms in a taxonomy?
- wp_query for multiple cities (multiple values in a metabox)
- Combining categories (Query posts with multiple taxonomy terms)
- Query with relation and one without relation using multiple taxonomies?
- How to display an other custom post type in a different custom post type’s archive?
- Search form not working with custom query?
- Post loop for all taxonomy terms
- Display custom tags on pages that have a specific page parent
- wp_query args adding muitiple tax_querys
- Automatically Query Parent Taxonomy
- Query most popular terms by taxonomy over 2 week period
- find posts that don’t have a custom taxonomy
- Filter Custom Taxonomy Posts
- WP_Query args to show posts from specific custom taxonomy
- WP_Query for a taxonomy with different taxonomy types
- How to set an alternate posts_per_page value for default queries in different templates
- Using custom taxonomies in a query
- How to add custom meta to ‘pre_get_terms’?
- Tax Query only returns for the first of several terms
- Can’t fetch Custom Post Type Data through Custom Query
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- One WP_Query that always shows 1 post from category X and 1 post from “not in category X”?
- How to print term name inside wp post loop
- Check if a post has term inside loop
- How to get posts by category and by choosing a taxonomy term?
- How to restrict search on a certain page to only return results against custom taxonomies?
- Query Taxonomy By Page Title
- Custom Taxonomy Breaks Pages
- check if a taxnomy queried in $wp_query?
- WP_Query tax_query – Show results if child has parent X
- Query custom taxonomy for category including children
- Tax_Query using WP_Query not working
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- get_the_terms has strange result since version 6.0
- How to display posts from custom post type category(custom Taxonomy) wise?
- wp-query and wp_get_post_terms on custom taxonomy archive page
- Why is my pagination /page/2 taking me to index.php?
- Show X taxonomies of the latest published posts
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- display ACF repater field in archive page
- Filter for each loop when WP_Query has no posts to show
- Custom Taxonomy – Modify Function to Get Child Category
- wp_set_object_terms() custom taxonomy not working correctly when using insert post