Skip to content

Instantly share code, notes, and snippets.

@JayWood
Created August 31, 2016 19:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayWood/f1773b7226fff8dc3e544d6c05591b1e to your computer and use it in GitHub Desktop.
Save JayWood/f1773b7226fff8dc3e544d6c05591b1e to your computer and use it in GitHub Desktop.
Woocommerce Product Class
<?php
function fb_1398591523488596( $classes, $class, $post_id ) {
if ( 'product' == get_post_type( $post_id ) ) {
$classes[] = "my-amazing-product-class";
}
return $classes;
}
add_filter( 'post_class', 'fb_1398591523488596', 10, 3 );
@urbanoantunes
Copy link

Working great!! Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment