Skip to content

Instantly share code, notes, and snippets.

@artikus11
Created October 13, 2021 16:43
Show Gist options
  • Save artikus11/eb3fa34f47c2c3f6f29fd4569dde9679 to your computer and use it in GitHub Desktop.
Save artikus11/eb3fa34f47c2c3f6f29fd4569dde9679 to your computer and use it in GitHub Desktop.
Изменение HTML заголовка товара на страницах архивов
/**
* Отключение заголовка товара на архивах
*
* @author Artem Abramovich
* @testedwith WC 5.8
*/
add_action( 'after_setup_theme', function () {
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 );
} );
/**
* Включение заголовка товара на архивах с собственным хтмл
*
* @author Artem Abramovich
* @testedwith WC 5.8
*/
add_action( 'woocommerce_shop_loop_item_title', function () {
printf(
'<h3 class="%s">%s</h3>',
esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ),
get_the_title()
);
}, 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment