Try this for WP_Query
$args = array(
'post_type' => 'example',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'identite',
'field' => 'ID',
'terms' => $term->term_id
)
),
);// end args
OR
$args = array(
'post_type' => 'example',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'identite',
'field' => 'ID',
'terms' => array($term->term_id)
)
),
);// end args
$term
is an object and tax_query
expects an array of id’s.
See: https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Related Posts:
- Missing posts in a query
- Select Query demand excesive resources [closed]
- No results for taxonomy archive page
- Get all image from single page using this query
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- Add multiple value to a query variable in WordPress
- wp_dropdown_categories with multiple select
- How to tune search argument in WP_Query to show only exactly the same results?
- How to find objects by terms
- How to get my loop to pull posts into three columns
- Custom $wpdb Query for Custom Post Type by Category
- Display Post by taxonomy and taxonomy child
- Can’t pass table to $wpdb->prepare
- How to extract all ID variables from a query string?
- Date query year and month OR just year
- Are database queries created using WordPress filters protected from SQL injection?
- get post id using the $query_vars variable
- Remove Unnecessary Mysql Query
- Grouping related postmeta data via SQL query
- Is there a conditional tag for latest post or do i need a query?
- wpdb::prepare() isn’t working
- How can I apply a meta query for a single custom post type in the main query?
- get_posts() loop returns the same the_title() for each post
- How to check current user in meta value array in WP_Query meta_query
- Using pre_get_posts to target a query in the sidebar
- How select a specific query when setting offset?
- Change media attachment author via mysql query
- How do I use get_query_var() within plguin code
- Order By Post Type ThenBy Taxonomy
- Custom query to filter posts that have current post as a taxonomy [closed]
- Exclude featured image and custom field from this get_attachment query
- Ordering by a metadata subfield in WordPress?
- Disable stored tags queries in admin page when posting a new post
- Alter query with posts_clauses to retrieve NULL values last
- Query based on title, with ‘compare’ => ‘IN’
- Issue with using add_rewrite_rule() for post querying custom fields
- Form and custom query problem
- Plugin will sort users by usermeta
- register_taxonomy() take much queries
- Exclude all sticky posts front page twenty twelve
- Query posts according to specific post meta values
- get csv of users with user_meta
- empty query breaks other queries
- Problem in exploding the_content to array
- Custom SQL Query passing array to WHERE p.id
- What is wrong with my wp query, cant exclude the category that i want
- how to insert missing tags into the posts through mySQL?
- How to write update query in WordPress to expire transients
- Query Nickname rather than Display Name in custom Woocommerce plugin
- get posts by tag to showing in a widget
- Get previous posts list
- how to replace old DW site with new WP site? [closed]
- Mysql query not working on WordPress 4.2.2
- WordPress SQL query to tag all posts containing a specific word on title
- get_post_meta with WP_query
- Order terms by count – missing terms
- Querying Advanced Custom Fields
- How to rearrange a pool of posts joined using two queries?
- wpdb update multiple row?
- How properly create a blog template for wordpress?
- Retrieve all term IDs of post
- Can I include get_posts in this array?
- Is there a way to add a link directly into this media query?
- Custom query Custom-Post-Types creates error
- Formatting a date/time returned from a custom $wpdb query
- Rewrite rule for query params
- WordPress Conditional / Multiple Taxonomy Query
- meta_query not working
- Cannot get sql request from Query object?
- Hook into the Admin Dashboard and redirect users
- WordPress query: merge meta key (number) values and sort
- Displaying data from custom table
- SEO friendly query vars
- Question about of query
- Prevent versioning for .woff (font) files
- Including taxonomy in searches
- Orderby event date (if it exists) or post date (if it doesn’t) – how to reorder posts based on meta value OR date
- Modify behaviour of “s” parameter in wp_query
- OR condition not working
- Admin view: filter posts by whether they have specific taxonomy attached
- Query not returning child posts for any parent post ID
- How to make MySQL search queries with quotes
- Limiting a filtered query
- Use $wpdb->get_results with filter based on array
- Add Hook for clearing transient when post is added
- How to filter the terms to a special custom taxonomy?
- Custom taxonomy – query returns an error
- Show links to child pages on both parent AND child pages
- Special Query: Title, Terms, Content – %LIKE%
- learn to run wpdb class
- Display old posts if no future posts exist
- Access Tables with number prefix
- Modify Global Posts Plugin
- How to reference same column name but different table in custom db query
- Retrieving custom field array value through db query
- how to add a read more button to my blog page?
- SQL Query : how copy all tags of post into their post content in wordpress by sql query
- Query parsing only author ids
- Query filter on custom post by current author in post widget for elementor query id
- Querying Posts from ACF Repeater Subfield Select Value