Advertisement
fahimmurshed

How to change WooCommerce products title tag

Jun 8th, 2020 (edited)
1,457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | Software | 0 0
  1. // Change WooCommerce Products title <h2> tags to <h3>
  2. // For more info visit https://fahimm.com
  3. if ( ! function_exists( 'woocommerce_template_loop_product_title' ) ) {
  4.  
  5. /**
  6. * Show the product title in the product loop. By default this is an H2.
  7. */
  8.     function woocommerce_template_loop_product_title() {
  9.         echo '<h3 class="woocommerce-loop-product__title">' . get_the_title() . '</h3>';
  10.     }
  11. }
  12.  
  13. // If that code does not work try this
  14. if ( ! function_exists( 'woocommerce_template_single_title' ) ) {
  15.  
  16.        function woocommerce_template_single_title() {
  17.         echo '<h3 class="woocommerce-product-title">' . get_the_title() . '</h3>';
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement