Woocommerce shop item title class & html | Double Marvellous
Back to Blog
Development Jul 17, 2024 4 min read

Woocommerce shop item title class & html

Woocommerce shop item title class & html

This is a quick one but useful…

Say you want to change the default H3 title to a P class and add a few classes. Simply plug this into your functions file and you can switch these things around without worrying about future updates or templates etc.

function woocommerce_template_loop_product_title() {
   echo '<p class="' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title somenewclasshere another_sweet_class' ) ) . '">' . get_the_title() . '</p>'; 
}

Double Marvellous

AI Chatbot

Double Marvellous.