array( 'default_rows' => 8, 'min_rows' => 5, 'max_rows' => 10, 'default_columns' => 4, 'min_columns' => 2, 'max_columns' => 4, ), ) ); // Add support for WooCommerce features. add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); // Remove default WooCommerce wrappers. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 ); } /** * Register shop widget area. */ public function widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Shop Sidebar', 'pressbook' ), 'id' => 'sidebar-shop', 'description' => esc_html__( 'Add widgets here.', 'pressbook' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } /** * Modify WooCommerce templates. */ public function woocommerce_modify() { add_action( 'woocommerce_before_main_content', array( $this, 'woocommerce_open_wrapper_columns' ), 7 ); add_action( 'woocommerce_before_main_content', array( $this, 'woocommerce_open_content_column' ), 9 ); add_action( 'woocommerce_after_main_content', array( $this, 'woocommerce_close_content_column' ), 7 ); if ( is_shop() || is_archive() ) { // Output the shop sidebar. add_action( 'woocommerce_after_main_content', 'woocommerce_get_sidebar', 9 ); } add_action( 'woocommerce_after_main_content', array( $this, 'woocommerce_close_wrapper_columns' ), 11 ); } /** * Opening wrapper. */ public function woocommerce_open_wrapper_columns() { ?>
>