/** * Add classes to <body> * * @param array $classes * * @return array */ function constructent_body_class($classes) { // Layout class $classes[] = constructent_layout(); // Class for layout style $classes[] = constructent_option('layout_style'); // Color scheme $custom_color_scheme = constructent_option('custom_color_scheme'); if (!$custom_color_scheme) { $classes[] = constructent_option('color_scheme'); } else { $classes[] = 'custom-color-scheme'; } // Class for custom header color if (constructent_option('header_custom') && constructent_option('header_background')) { $classes[] = 'header-custom'; } // Class for woocommerce columns if (function_exists('is_shop') && (is_shop() || is_product_taxonomy())) { global $woocommerce_loop; if (empty($woocommerce_loop['columns'])) { $columns = 'full-content' == constructent_layout() ? 4 : 3; } else { $columns = $woocommerce_loop['columns']; } $classes[] = 'columns-' . esc_attr($columns); } // Class for solid header $header_type = constructent_option('header_type'); $header_type = $header_type ? esc_attr($header_type) : 'static'; if ($header_type == 'absolute' && !is_page_template('tpl/homepage.php')) { $classes[] = 'header-static'; } else { $classes[] = 'header-' . $header_type; } // Transparent header if ('absolute' == $header_type && is_page_template('tpl/homepage.php') && constructent_option('header_transparent')) { $classes[] = 'header-transparent'; } // Class for menu hover if ($hover = constructent_option('menu_hover')) { $classes[] = 'menu-hover-' . $hover; } // If no featured title area if (!constructent_show_featured_title()) { $classes[] = 'no-title-area'; } // Class for portfolio layout if (is_page_template('tpl/portfolio.php')) { $classes[] = 'portfolio-' . constructent_meta('style_portfolio'); } // Class for portfolio category layout if (is_tax('portfolio_category')) { $classes[] = 'portfolio-' . constructent_option('portfolio_view'); } $classes = array_unique(array_filter($classes)); return $classes; }
/** * Hooks to WooCommerce actions, filters * * @since 1.0 * @return void */ function hooks() { $this->layout = constructent_layout(); // Sale flash add_filter('woocommerce_sale_flash', array($this, 'sale_flash')); add_filter('woocommerce_show_page_title', '__return_false'); remove_action('woocommerce_before_main_content', 'woocommerce_breadcrumb', 20); remove_action('woocommerce_before_shop_loop', 'woocommerce_result_count', 20); remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30); add_filter('loop_shop_columns', array($this, 'shop_columns')); add_filter('post_class', array($this, 'product_class'), 10, 3); add_action('woocommerce_before_shop_loop_item_title', array($this, 'open_wrapper'), 30); add_action('woocommerce_after_shop_loop_item_title', array($this, 'close_wrapper'), 30); add_filter('woocommerce_pagination_args', array($this, 'pagination_args')); // Fix dash symbol for Ubuntu font add_filter('woocommerce_get_price_html', array($this, 'price_html')); // Remove cross sell products from cart page remove_action('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display'); }
<?php $base = constructent_template_base(); $file = constructent_template_path(); $layout = constructent_layout(); $container = 'container'; $classes = array('hfeed site-content col-xs-12'); $classes[] = 'full-content' == $layout ? 'col-sm-12 col-md-12' : 'col-sm-12 col-md-8'; $classes = implode(' ', $classes); if (is_page_template('tpl/contact.php')) { $container = 'container-fluid'; } get_header($base); ?> <main id="main" class="main clearfix" role="main"> <div class="<?php echo $container; ?> "> <div class="row"> <section id="content" class="site-content <?php echo $classes; ?> " role="main"> <?php include $file; ?> </section>