I was using Query Monitor to see what template parts were being loaded for the store and product archives pages and noticed that on the store home page the sidebar-shop template part was shown as being included twice.
After much debug tracing I confirmed it wasn't a bug in Query Monitor and that it was a minor bug in the theme.
In archive-product.php the sidebar is included using get_sidebar('shop').
Then it's requested again by the magic of WooCommerce when do_action( 'woocommerce_sidebar') is run at the end of the template.
This second invocation doesn't occur in taxonomy-product-cat-.php since the do_action call is commented out.
Note: On the store page we don't see the sidebar being loaded more than once since the default processing when loading a sidebar is to call load_template() with $load_once=true, causing it to use require_once.
Proposed fix
Comment out the call to do_action('woocommerce_sidebar' ) in woocommerce\archive-product.php
I was using Query Monitor to see what template parts were being loaded for the store and product archives pages and noticed that on the store home page the
sidebar-shop
template part was shown as being included twice.After much debug tracing I confirmed it wasn't a bug in Query Monitor and that it was a minor bug in the theme.
In
archive-product.php
the sidebar is included usingget_sidebar('shop')
. Then it's requested again by the magic of WooCommerce whendo_action( 'woocommerce_sidebar')
is run at the end of the template.This second invocation doesn't occur in
taxonomy-product-cat-.php
since thedo_action
call is commented out.Note: On the store page we don't see the sidebar being loaded more than once since the default processing when loading a sidebar is to call
load_template()
with$load_once=true
, causing it to userequire_once
.Proposed fix
do_action('woocommerce_sidebar' )
inwoocommerce\archive-product.php