Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
is_product_category() example
if ( is_product_category() ) {
if ( is_product_category( 'shirts' ) ) {
echo 'Hi! Take a look at our sweet tshirts below.';
} elseif ( is_product_category( 'games' ) ) {
echo 'Hi! Hungry for some gaming?';
} else {
echo 'Hi! Check our our products below.';
}
}

CNick commented Oct 13, 2015

Is there a conditional tag for parent or descendant categories?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment