Wordpress

Customizing woocommerce product title

Yes. You can add tags or whatever you want you can add next to the woocommerce product title. In this article, we are customizing the woocommerce product title.
Let’s get started
make a note that, what you have to modify in the woocommerce product title. Then open your active theme’s functions.php file and paste the below code.

remove_action('woocommerce_single_product_summary','woocommerce_template_single_title',5);
add_action('woocommerce_single_product_summary', 'woocommerce_my_single_title',5);

if ( ! function_exists( 'woocommerce_my_single_title' ) ) {
function woocommerce_my_single_title() {
?>
<h1 itemprop="name" class="product_title entry-title"><span><?php the_title(); ?></span></h1>
<?php
}
}

Now you can see the changes in woocommerce product title, by inspecting the element. here in this example, we have added the <span> tag to the title. In this place, you can modify as per your requirement.

I hope this article helped for queries. If you are looking more customization, please comment in the comment section below.

Happy coding 🙂

About the author

Vishwas

Vishwas

Vishwas Hegde is the architect of ProCodersOnline.com. I'm a Software Engineer and technology enthusiast person who loves to learn and explore new things and technologies. When i'm not writing content for my websites, I love to travel and explore the nature.

Add Comment

Click here to post a comment