add_filter( 'woocommerce_post_class', 'add_category_class'); function add_category_class( $classes ) { $custom_videoclass = get_post_meta(get_the_ID(), 'produktvideoclass', true); if ( 'product' == get_post_type() ) { $classes[] = $custom_videoclass; } return $classes; }