Skip to content

Instantly share code, notes, and snippets.

@emzo
Created June 17, 2016 11:08
Show Gist options
  • Save emzo/86008d899cb8139af0798e61dc72f7e7 to your computer and use it in GitHub Desktop.
Save emzo/86008d899cb8139af0798e61dc72f7e7 to your computer and use it in GitHub Desktop.
<?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