Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created July 19, 2012 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/3143148 to your computer and use it in GitHub Desktop.
Save mikejolley/3143148 to your computer and use it in GitHub Desktop.
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
Copy link

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