Title: Problem with wp_query and polylang
Last modified: November 28, 2017

---

# Problem with wp_query and polylang

 *  [azralth](https://wordpress.org/support/users/azralth/)
 * (@azralth)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/problem-with-wp_query-and-polylang/)
 * Hi,
    I need some help with a query.
 * Here is my code :
 *     ```
       $args = array(
       	'posts_per_page'	=> -1,
       	'post_type'		=> 'transfer',
       	'lang'			=> 'fr',
       	'tax_query'		=> array(
       		'relation'	=>'AND',
       		array(
       			'taxonomy' =>'city-to',
       			'field'		=> 'slug',
       			'terms'	=> array('grenoble')
       		)
       	)
       );
       $query =  new \WP_Query($args);
       ```
   
 * The array in terms field contain only term slug in “fr” lang, whatever if i am
   in english or french page.
 * This works perfectly fine if i am on an french page. He find all the post.
 * But when i am in english page, this not working and the query can’t find any 
   post.
 * What i want to do is find all the post only in french. If i do this :
    $args 
   = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘transfer’, ‘lang’ => ‘fr’, );`
 * It works perfectly in all lang, “fr” and “en”. But when i add the tax_query array
   in my $args it does not work anymore only on “en” page.
 * I use polylang plugin and all help will be great.
    Thanks
    -  This topic was modified 8 years, 6 months ago by [azralth](https://wordpress.org/support/users/azralth/).

Viewing 1 replies (of 1 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/problem-with-wp_query-and-polylang/#post-9730919)
 * I recommend asking at [https://wordpress.org/support/plugin/polylang](https://wordpress.org/support/plugin/polylang)
   so the plugin’s developers and support community can help you with this.

Viewing 1 replies (of 1 total)

The topic ‘Problem with wp_query and polylang’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/problem-with-wp_query-and-polylang/#post-9730919)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
