Filter/hook to add class to h1 on single-product.php
-
I’m looking at my Single Product title template:
the_title( '<h1 class="product_title entry-title">', '</h1>' );
And I want to add a class (‘small’) to the title without modifying the template (to avoid problems with future updates).I’d like to plop in a filter but don’t know how to do this. I suspect it’s something like this:
add_filter( 'woocommerce_product_loop_title_classes', 'custom_woocommerce_product_title_classes' ); function custom_woocommerce_product_title_classes( $class ) { return $class . ' small'; }
Which seems to work for the shop page, but not the single product page.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Filter/hook to add class to h1 on single-product.php’ is closed to new replies.