Brak opisu

class-wc-twenty-fourteen.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Twenty Fourteen support.
  4. *
  5. * @class WC_Twenty_Fourteen
  6. * @since 3.3.0
  7. * @package WooCommerce\Classes
  8. */
  9. defined( 'ABSPATH' ) || exit;
  10. /**
  11. * WC_Twenty_Fourteen class.
  12. */
  13. class WC_Twenty_Fourteen {
  14. /**
  15. * Theme init.
  16. */
  17. public static function init() {
  18. // Remove default wrappers.
  19. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper' );
  20. remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end' );
  21. // Add custom wrappers.
  22. add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ) );
  23. add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ) );
  24. // Declare theme support for features.
  25. add_theme_support( 'wc-product-gallery-zoom' );
  26. add_theme_support( 'wc-product-gallery-lightbox' );
  27. add_theme_support( 'wc-product-gallery-slider' );
  28. add_theme_support(
  29. 'woocommerce',
  30. array(
  31. 'thumbnail_image_width' => 150,
  32. 'single_image_width' => 300,
  33. )
  34. );
  35. }
  36. /**
  37. * Open wrappers.
  38. */
  39. public static function output_content_wrapper() {
  40. echo '<div id="primary" class="content-area"><div id="content" role="main" class="site-content twentyfourteen"><div class="tfwc">';
  41. }
  42. /**
  43. * Close wrappers.
  44. */
  45. public static function output_content_wrapper_end() {
  46. echo '</div></div></div>';
  47. get_sidebar( 'content' );
  48. }
  49. }
  50. WC_Twenty_Fourteen::init();