Book a Free Call

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>'; 
}

Need rapid website development:

For smaller projects at high speed


  • Adding script tag embed to Gatsby component

    Read More
  • Get more than 100 queries in GraphQL (I felt stupid)

    Read More
  • Animate on Scroll (AOS) into Nuxt js

    Read More
  • WordPress Super-admin hack

    Read More
  • Add content or ACF field under thumbnail/image gallery in Woocommerce

    Read More

Tags


Categories

Is it urgent? Donate to Cork Simon

Got an urgent issue?

Charlie's Cottage, Carrigrohane, Co. Cork, T12 WY9H

(085) 7686677