is product page woocommerce
if( is_product() ) {
// do something
} else {
}
is product page woocommerce
if( is_product() ) {
// do something
} else {
}
woocommerce create product specific template
add_filter('body_class','wpa76627_class_names');
function wpa76627_class_names( $classes ) {
if( is_singular( 'product' ) ):
global $post;
foreach( get_the_terms( $post->ID, 'product_cat' ) as $cat )
// maybe you want to make this more unique, like:
// $classes[] = 'product-category-' . $cat->slug;
$classes[] = $cat->slug;
endif;
return $classes;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us