Created
June 17, 2016 11:08
-
-
Save emzo/86008d899cb8139af0798e61dc72f7e7 to your computer and use it in GitHub Desktop.
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 darpar_body_class( $classes ) { | |
if ( is_singular() && has_post_thumbnail() ) { | |
array_push( $classes, 'has-thumbnail' ); | |
} | |
if ( is_product_category() && get_woocommerce_term_meta( get_queried_object_id(), 'thumbnail_id', true ) ) { | |
array_push( $classes, 'emyr' ); | |
}; | |
return $classes; | |
} | |
add_filter( 'body_class', 'darpar_body_class' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment