This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_custom_classes( $classes, $class, $post_id ) { | |
if ( 'product' == get_post_type( $post_id ) ) { | |
$classes[] = "sm-pid-" . $post_id; | |
// Post Class on Single Product | |
if ( is_singular( 'product' ) ) { | |
$classes[] = "sm-product-view"; | |
// Post Clas Product Archives Listing | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fb_1398591523488596( $classes, $class, $post_id ) { | |
if ( 'product' == get_post_type( $post_id ) ) { | |
if ( is_singular( 'product' ) ) { | |
$classes[] = "post-class-when-viewing-single-product"; | |
} else { | |
$classes[] = "non-single-product-page-class" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fb_1398591523488596( $classes, $class, $post_id ) { | |
if ( 'product' == get_post_type( $post_id ) ) { | |
$classes[] = "my-amazing-product-class"; | |
} | |
return $classes; | |
} |