class-wc-twenty-ten.php 1.3 KB

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