WordPress.org

Ready to get started?Download WordPress

Forums

WP_Query ignores my tax_query (1 post)

  1. Pimouls
    Member
    Posted 1 year ago #

    Hi,

    First of all, I apologize for my poor english.

    I'm trying to retrive the posts (of post-type "liens") that have the term "formation" of the "tax_liens_pages" taxonomy, but it appears that my tax_query is just ignored.
    When I print out the result of my query, I get all the posts of post-type "liens".

    I'm struggling to find what's wrong, but I didn't succeed so far.

    I'm 100% sure that my taxonomy and my custom post-type are OK (checked the database)

    Here is my query :

    $liens_args = array(
    		'post_type' => 'liens',
    		'tax-query' => array(
    			array(
    				'taxonomy' => 'tax_liens_pages',
    				'field' => 'slug',
    				'terms' => 'formation'
    			)
    		)
    	);
    	// request
    	$liens = new WP_Query( $liens_args );

    Can you think of something ?

Topic Closed

This topic has been closed to new replies.

About this Topic