class-wc-twenty-eleven.php
5 years ago
class-wc-twenty-fifteen.php
5 years ago
class-wc-twenty-fourteen.php
5 years ago
class-wc-twenty-nineteen.php
5 years ago
class-wc-twenty-seventeen.php
5 years ago
class-wc-twenty-sixteen.php
5 years ago
class-wc-twenty-ten.php
5 years ago
class-wc-twenty-thirteen.php
5 years ago
class-wc-twenty-twelve.php
2 years ago
class-wc-twenty-twenty-one.php
5 years ago
class-wc-twenty-twenty-three.php
3 years ago
class-wc-twenty-twenty-two.php
4 years ago
class-wc-twenty-twenty.php
5 years ago
class-wc-twenty-twelve.php
76 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Twenty Twelve support. |
| 4 | * |
| 5 | * @class WC_Twenty_Twelve |
| 6 | * @since 3.3.0 |
| 7 | * @package WooCommerce\Classes |
| 8 | */ |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | /** |
| 13 | * WC_Twenty_Twelve class. |
| 14 | */ |
| 15 | class WC_Twenty_Twelve { |
| 16 | |
| 17 | /** |
| 18 | * Theme init. |
| 19 | */ |
| 20 | public static function init() { |
| 21 | // Remove default wrappers. |
| 22 | remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper' ); |
| 23 | remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end' ); |
| 24 | |
| 25 | // Add custom wrappers. |
| 26 | add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ) ); |
| 27 | add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ) ); |
| 28 | |
| 29 | // Enqueue theme compatibility styles. |
| 30 | add_action( 'wp_head', array( __CLASS__, 'enqueue_styles' ) ); |
| 31 | |
| 32 | // Declare theme support for features. |
| 33 | add_theme_support( 'wc-product-gallery-zoom' ); |
| 34 | add_theme_support( 'wc-product-gallery-lightbox' ); |
| 35 | add_theme_support( 'wc-product-gallery-slider' ); |
| 36 | add_theme_support( |
| 37 | 'woocommerce', |
| 38 | array( |
| 39 | 'thumbnail_image_width' => 200, |
| 40 | 'single_image_width' => 300, |
| 41 | ) |
| 42 | ); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Open wrappers. |
| 47 | */ |
| 48 | public static function output_content_wrapper() { |
| 49 | echo '<div id="primary" class="site-content"><div id="content" role="main" class="twentytwelve">'; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Close wrappers. |
| 54 | */ |
| 55 | public static function output_content_wrapper_end() { |
| 56 | echo '</div></div>'; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Add theme compatibility styles. |
| 61 | * |
| 62 | * @return void |
| 63 | */ |
| 64 | public static function enqueue_styles() { |
| 65 | ?> |
| 66 | <style type="text/css"> |
| 67 | .wc-block-components-notice-banner.is-error li { |
| 68 | margin: 0; |
| 69 | } |
| 70 | </style> |
| 71 | <?php |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | WC_Twenty_Twelve::init(); |
| 76 |