Skip to content
Advertisement

How can I change the product in Woocommerce Storefront to ?

I’m using a child theme to Woocommerce’s Storefront theme. On the home page, it is rendering the product names of the featured products as h2s. I would like to change these to h3s (SEO reasons).

The h2s use this class: woocommerce-loop-product__title. I searched through the Storefront theme, and the only place I found that class was in CSS.

I looked in this file: /storefront/inc/storefront-template-functions.php and found this code:

JavaScript

}

I think this runs the Featured Products section.

I tried changing this code:

JavaScript

to:

JavaScript

I uploaded the /inc/ folder to my child directory, and there were no changes. I tried uploaded the storefront-template-functions.php file into the /inc/ file of the original storefront theme. Again, nothing happened.

I’m stumped. I really thought I had the correct bit of code to change these to h3s. Any idea what I need to do to change the Featured Product h2s into h3s?

Advertisement

Answer

Well, it turns out that I was looking in the wrong place and doing the wrong thing. I needed to add something to the functions.php file in my child theme to get this to work. Here’s what I added:

JavaScript

I got the basis for this code from this answer: When changing woocommerce title hook the first item doesn’t change

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement