Title: Problem with taxonomy
Last modified: August 21, 2016

---

# Problem with taxonomy

 *  Resolved [iivvvii](https://wordpress.org/support/users/iivvvii/)
 * (@iivvvii)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-taxonomy/)
 * This is my code:
 *     ```
       $zoekQuery = array('post_type' => 'spots',
       	'post_status' => 'publish',
       	'posts_per_page' => 15,
       	'orderby' => 'title',
       	'order' => 'ASC',
       	'paged' => $paged,
       	's' => $dzoekterm,
       	'tax_query' => array(
       		'relation' => 'AND',
       		$eactiviteiten,
       		$eprovincies,
       		$esferen,
       		$eomgevingen,
       		$ebudgetten,
       		$efaciliteiten
       	)
       $wp_query->query($zoekQuery);
       ```
   
 * Unfortanatly this doesn’t give any results. If I turn relevanssi plugin off this
   code is working fine. When I remove the tax_query part it is also working fine.
 * If also tried to rebuild to code to setting $wp_query->query_vars and relevanssi_do_query(
   $wp_query);. But this gives the same result.
 * I hope somebody can help, thanks in advance.
 * [http://wordpress.org/extend/plugins/relevanssi/](http://wordpress.org/extend/plugins/relevanssi/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [iivvvii](https://wordpress.org/support/users/iivvvii/)
 * (@iivvvii)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-taxonomy/#post-3678181)
 * alright eventually it was quite easy to fix, so for anyone facing the same problem:
 * Some of the array’s stored in the vars $eactiviteiten until $efaciliteiten could
   be empty in certain cases. Apparently the default wordpress search doesn’t care
   about that. But relevanssi had some SQL errors when some of those vars are empty.
   Now i checke the vars and only add them to the tax_query wen the array is not
   empty.

Viewing 1 replies (of 1 total)

The topic ‘Problem with taxonomy’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [iivvvii](https://wordpress.org/support/users/iivvvii/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/problem-with-taxonomy/#post-3678181)
 * Status: resolved