WC_Twenty_Seventeen

Twenty Seventeen suport.

Defined (1)

The class is defined in the following location(s).

/includes/theme-support/class-wc-twenty-seventeen.php  
  1. class WC_Twenty_Seventeen { 
  2.  
  3. /** 
  4. * Theme init. 
  5. */ 
  6. public static function init() { 
  7. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); 
  8. remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); 
  9.  
  10. add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ), 10 ); 
  11. add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ), 10 ); 
  12. add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) ); 
  13.  
  14. /** 
  15. * Enqueue CSS for this theme. 
  16. * @param array $styles 
  17. * @return array 
  18. */ 
  19. public static function enqueue_styles( $styles ) { 
  20. unset( $styles['woocommerce-general'] ); 
  21.  
  22. $styles['woocommerce-twenty-seventeen'] = array( 
  23. 'src' => str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/css/twenty-seventeen.css',  
  24. 'deps' => '',  
  25. 'version' => WC_VERSION,  
  26. 'media' => 'all',  
  27. ); 
  28.  
  29. return apply_filters( 'woocommerce_twenty_seventeen_styles', $styles ); 
  30.  
  31. /** 
  32. * Open the Twenty Seventeen wrapper. 
  33. */ 
  34. public static function output_content_wrapper() { ?> 
  35. <div class="wrap"> 
  36. <div id="primary" class="content-area twentyseventeen"> 
  37. <main id="main" class="site-main" role="main"> 
  38. <?php 
  39.  
  40. /** 
  41. * Close the Twenty Seventeen wrapper. 
  42. */ 
  43. public static function output_content_wrapper_end() { ?> 
  44. </main> 
  45. </div> 
  46. <?php get_sidebar(); ?> 
  47. </div> 
  48. <?php