/** * Extend the default WordPress body classes. * * @since 1.0 * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ function cruxstore_wc_body_classes($classes) { if (is_product()) { $layout = cruxstore_get_product_layout(); $classes[] = 'product-' . $layout; } return $classes; }
<?php /** * woocommerce_before_single_product hook. * * @hooked wc_print_notices - 10 */ do_action('woocommerce_before_single_product'); if (post_password_required()) { echo get_the_password_form(); return; } ?> </div> <?php $layout = cruxstore_get_product_layout(); $classes = array('wc-single-product', 'product-' . $layout); ?> <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?> " id="product-<?php the_ID(); ?> " <?php post_class($classes); ?> > <?php