Created
October 13, 2021 16:43
-
-
Save artikus11/eb3fa34f47c2c3f6f29fd4569dde9679 to your computer and use it in GitHub Desktop.
Изменение HTML заголовка товара на страницах архивов
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Отключение заголовка товара на архивах | |
* | |
* @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