File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed
app/integrations/woocommerce Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -364,16 +364,19 @@ function bigbox_woocommerce_template_loop_stock() {
364
364
};
365
365
366
366
/**
367
- * Remove tertiary sidebar on inner pages .
367
+ * Manage sidebar locations and outputs .
368
368
*
369
369
* @since 1.0.0
370
370
*/
371
- function bigbox_woocommerce_template_tertiary () {
372
- // Remove (filters) sidebar on single products.
373
- if ( is_singular ( 'product ' ) ) {
374
- remove_action ( 'woocommerce_sidebar ' , 'woocommerce_get_sidebar ' );
375
- // Add (tertiary) sidebar on archives.
376
- } else {
371
+ function bigbox_woocommerce_template_sidebars () {
372
+ // Remove default output.
373
+ remove_action ( 'woocommerce_sidebar ' , 'woocommerce_get_sidebar ' );
374
+
375
+ if ( ! is_singular ( 'product ' ) ) {
376
+ // Add sidebar before main column.
377
+ add_action ( 'woocommerce_before_main_content ' , 'woocommerce_get_sidebar ' , 0 );
378
+
379
+ // Output tertiary sidebar.
377
380
add_action (
378
381
'woocommerce_sidebar ' ,
379
382
function () {
Original file line number Diff line number Diff line change 35
35
* File: archive-product.php.
36
36
*/
37
37
38
- // Move sidebar before content for better tab order.
39
- remove_action ( 'woocommerce_sidebar ' , 'woocommerce_get_sidebar ' );
40
- add_action ( 'woocommerce_before_main_content ' , 'woocommerce_get_sidebar ' , 0 );
38
+ // Remove sidebar on single product pages.
39
+ add_action ( 'wp ' , 'bigbox_woocommerce_template_sidebars ' );
41
40
42
41
// Replace outer content wrapper.
43
42
remove_action ( 'woocommerce_before_main_content ' , 'woocommerce_output_content_wrapper ' );
@@ -104,9 +103,6 @@ function() {
104
103
* File: content-single-product.php.
105
104
*/
106
105
107
- // Remove sidebar on single product pages.
108
- add_action ( 'wp ' , 'bigbox_woocommerce_template_tertiary ' );
109
-
110
106
// Filter product tabs.
111
107
add_filter ( 'woocommerce_product_tabs ' , 'bigbox_woocommerce_product_tabs ' , 20 );
112
108
You can’t perform that action at this time.
0 commit comments