2016-11-25 15:17:13 +00:00
|
|
|
<?php
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2016-12-07 12:45:54 +00:00
|
|
|
exit;
|
2016-11-25 15:17:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Twenty Seventeen suport.
|
|
|
|
*
|
|
|
|
* @class WC_Twenty_Seventeen
|
2016-12-07 12:45:54 +00:00
|
|
|
* @since 2.6.9
|
|
|
|
* @version 2.6.9
|
2016-11-25 15:17:13 +00:00
|
|
|
* @package WooCommerce/Classes
|
|
|
|
*/
|
|
|
|
class WC_Twenty_Seventeen {
|
|
|
|
|
|
|
|
/**
|
2017-02-24 12:41:15 +00:00
|
|
|
* Theme init.
|
2016-11-25 15:17:13 +00:00
|
|
|
*/
|
2017-02-24 19:10:34 +00:00
|
|
|
public static function init() {
|
2016-11-25 15:17:13 +00:00
|
|
|
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
|
|
|
|
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
|
|
|
|
|
2017-02-24 12:41:15 +00:00
|
|
|
add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ), 10 );
|
|
|
|
add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ), 10 );
|
|
|
|
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
|
2016-11-25 15:17:13 +00:00
|
|
|
}
|
|
|
|
|
2016-12-07 12:45:54 +00:00
|
|
|
/**
|
|
|
|
* Enqueue CSS for this theme.
|
|
|
|
*
|
|
|
|
* @param array $styles
|
|
|
|
* @return array
|
|
|
|
*/
|
2017-02-24 12:41:15 +00:00
|
|
|
public static function enqueue_styles( $styles ) {
|
2016-11-25 15:17:13 +00:00
|
|
|
unset( $styles['woocommerce-general'] );
|
|
|
|
|
|
|
|
$styles['woocommerce-twenty-seventeen'] = array(
|
2016-11-25 16:10:58 +00:00
|
|
|
'src' => str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/css/twenty-seventeen.css',
|
2016-11-25 15:17:13 +00:00
|
|
|
'deps' => '',
|
|
|
|
'version' => WC_VERSION,
|
|
|
|
'media' => 'all',
|
|
|
|
);
|
|
|
|
|
|
|
|
return apply_filters( 'woocommerce_twenty_seventeen_styles', $styles );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 12:45:54 +00:00
|
|
|
* Open the Twenty Seventeen wrapper.
|
2016-11-25 15:17:13 +00:00
|
|
|
*/
|
2017-02-24 12:41:15 +00:00
|
|
|
public static function output_content_wrapper() { ?>
|
2016-11-25 15:17:13 +00:00
|
|
|
<div class="wrap">
|
|
|
|
<div id="primary" class="content-area twentyseventeen">
|
|
|
|
<main id="main" class="site-main" role="main">
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 12:45:54 +00:00
|
|
|
* Close the Twenty Seventeen wrapper.
|
2016-11-25 15:17:13 +00:00
|
|
|
*/
|
2017-02-24 12:41:15 +00:00
|
|
|
public static function output_content_wrapper_end() { ?>
|
2016-11-25 15:17:13 +00:00
|
|
|
</main>
|
|
|
|
</div>
|
2016-11-28 12:11:19 +00:00
|
|
|
<?php get_sidebar(); ?>
|
2016-11-25 15:17:13 +00:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-24 12:41:15 +00:00
|
|
|
WC_Twenty_Seventeen::init();
|