Title: Conditional query&#039;s doesn&#039;t work
Last modified: September 1, 2016

---

# Conditional query's doesn't work

 *  [studiokahn](https://wordpress.org/support/users/studiokahn/)
 * (@studiokahn)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/conditional-querys-doesnt-work/)
 * Hi there
 * I am trying to display a custom single product page with query is_product_category()
   or is_product_tag()
 * It just doesn’t work! I turned it from the inside out and I keep scratching my
   head! The normal page loads. The query returns always false.
 * The code is as follows:
    [https://postimg.org/image/amvvx8gcx/](https://postimg.org/image/amvvx8gcx/)
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 1 replies (of 1 total)

 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [9 years, 10 months ago](https://wordpress.org/support/topic/conditional-querys-doesnt-work/#post-7615072)
 * Those conditionals will return true when on the archive pages only – not if the
   single product page belongs to that category / has the tag.
 * You’ll need to use this WordPress conditional: [https://codex.wordpress.org/Function_Reference/has_term](https://codex.wordpress.org/Function_Reference/has_term)
 * `if ( is_product() && has_term( 'your_category', 'product_cat' ) )`

Viewing 1 replies (of 1 total)

The topic ‘Conditional query's doesn't work’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/conditional-querys-doesnt-work/#post-7615072)
 * Status: not resolved