In the below image you can see. By default, WooCommerce displays the title in the H2 tag which can be bigger or smaller according to design. let’s see how we can change the tag with a simple snippet.
Here is a useful snippet that makes it easy to change the title tag. Add the following to the function.php in your child theme.
//WooCommerce Change Title from H2 -> H3
function wps_change_products_title() {
echo '<h3 class="woocommerce-loop-product__title">'. get_the_title() . '</h3>';
}
remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
add_action('woocommerce_shop_loop_item_title', 'wps_change_products_title', 10);
Exactly what I needed. Thanks!
It worked for me, thank you very much!
Good Job! Exactly what I was looking for!
that was perfect.