add a new hook in the archive-product.php template for the header template

This commit is contained in:
Tommy Ferry 2024-01-10 17:05:46 +00:00 committed by Jonathan Sadowski
parent 891a3d1a4e
commit 4c676867f4
3 changed files with 11 additions and 5 deletions

View File

@ -1250,9 +1250,7 @@ if ( ! function_exists( 'woocommerce_product_taxonomy_archive_header' ) ) {
* Output the products header on taxonomy archives.
*/
function woocommerce_product_taxonomy_archive_header() {
if ( is_product_taxonomy() ) {
wc_get_template( 'loop/header.php' );
}
wc_get_template( 'loop/header.php' );
}
}

View File

@ -58,7 +58,7 @@ add_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
*
* @see woocommerce_product_taxonomy_archive_header()
*/
add_action( 'woocommerce_before_main_content', 'woocommerce_product_taxonomy_archive_header', 40 );
add_action( 'woocommerce_shop_loop_header', 'woocommerce_product_taxonomy_archive_header' );
/**
* Archive descriptions.

View File

@ -25,10 +25,18 @@ get_header( 'shop' );
* @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
* @hooked woocommerce_breadcrumb - 20
* @hooked WC_Structured_Data::generate_website_data() - 30
* @hooked woocommerce_product_taxonomy_archive_header - 40
*/
do_action( 'woocommerce_before_main_content' );
/**
* Hook: woocommerce_shop_loop_header.
*
* @since 8.6.0
*
* @hooked woocommerce_product_taxonomy_archive_header - 10
*/
do_action( 'woocommerce_shop_loop_header' );
if ( woocommerce_product_loop() ) {
/**