I’ve got an answer that worked perfeclty for me in another forum, so I’ll post here if sometime anyone gets a similar problem
$argsPost = array(
'post_type'=>'album',
'orderby'=>'date',
'order' => 'DESC',
'posts_per_page'=>'4',
'tax_query' => array(
array(
'taxonomy' => 'albuns_categories',
'field' => 'slug',
'terms' => array( 'ANYTERM' ),
'operator' => 'IN'
)
)
);
=D
Related Posts:
- The Operator “NOT IN” Does Not Work In tax_query
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Combine tax_query and meta_query in WP_Query
- tax_query returning all posts instead of selective posts in WP_Query
- Custom post taxonomies as tax_query terms?
- Why is this query not working? (Standard posts + custom post type)
- Custom Widget WP_Query problem
- How to display Related Posts based on number of taxonomy terms matched
- tax_query not working in template
- WP_query – Filter by tax_query and meta_query using multiple select
- WP_Query parameter conflict
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- tax_query (if the terms are empty)
- Running a custom query inside another cpt single and trying to grab a variable
- Custom Query: Multiple CPTs and a taxonomy filter
- Display related CPT with custom taxonomy
- custom post type and a “sticky” position taxonomy
- How to search through all child taxonomies using WP_Query?
- WP Query tax_query not returning posts
- Not able to get my custom search result using meta_query and tax_query together?
- Query breaking with ‘posts_per_page’ => -1
- tax_query showing no results
- Cannot query custom post type taxonomy from theme options array
- Using tax_query to get single post per category
- WP Query Conditionally query meta and taxonomy
- Meta query with boolean true/false value
- Get Posts in a Custom Post Type category
- Search multiple custom fields by using meta_query
- category__in not working on custom post type
- Date query for a custom meta field
- Querying Posts by Taxonomy From Alternate Network Site
- How to query for posts (in hierarchical custom post type) that have children?
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Query for posts in 2 taxonomies
- Parent / Child formatting in a list of post of a custom post type
- How do I create an archive page for standard posts?
- Multiple post type queries (with specific arguments for each)
- Custom WP_Query not returning results when querying custom post type
- Custom Post Type Loop within Shortcode
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- Show custom post type filtered by category
- Filtering WP_Query
- Get latest 3 posts from multiple CPT in one query
- Display upcoming Events for next 7 Days
- Orderby CPT custom fields not working
- How to order WP_Query by parent for hierarchical Custom Post Type?
- Custom post type ‘articles’ ignores posts_per_page, reserved post_type?
- WP Query with categories only shows one post and ignores the category
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- Can I display custom post types in home.php or need page template?
- Sort posts in loop by the WooCommerce Membership of the author
- WordPress wp_query() basic question about args
- How to get specific post meta by title or id
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- WP_Query of custom post type sorted by meta_key has unexpected results
- How to get the post terms from a child taxonomy
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Pagination for search results of custom post type [duplicate]
- WP_Query get post from a category and from another post type
- Custom Plugin – Query CPT – Display Results
- foreach loop inside the loop creating duplicates in output
- All blog posts are not showing up
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Custom post-type custom query – show all posts
- Display custom-post type based on the Title matching the current selected value
- meta query condition don’t work
- Numeric pagination custom post type
- Filter posts by their related field’s custom field
- Custom post type category returns null
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- Tell wordpress to show a single page instead of an archive page
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- How do I get all authors posts of a custom post type outside loop
- minimize wp_query call to database
- WP Query filter search. Result show all posts instead just custom post type
- sorting in wp query based on custom field value
- Display posts of a hierarchical custom post type excluding parent posts
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- WordPress loop add heading before first of type
- Only show current category post
- get_post_meta for Custom Post Type ( CPT )
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- WP_Query for CPT with filter by another WP_Query
- Is it possible to add query parameters on the archive page?
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Query stopped working
- How can I base a query off of the current page post type AND a meta value from another custom post type
- WP_Query and two custom fields returns no posts
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- Fallback if statement based on the number filtered from it
- Custom Post-type not returning the right child_of
- How do I hide single category post on my post page
- querying to custom field over ACF REST API
- Assign a tag to custom post type using a query
- Query order by a numeric ACF field