So as promised I will do a lot more posts on this blog and to kick things off I am doing a snippet on how to change the WooCommerce single product description tab title and heading to that of the product name instead of just saying Description.
To change the WooCommerce Single Product Description tab title and heading to the product name, place the following PHP code in your theme’s functions.php file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change the description tab title to product name | |
add_filter( 'woocommerce_product_tabs', 'wc_change_product_description_tab_title', 10, 1 ); | |
function wc_change_product_description_tab_title( $tabs ) { | |
global $post; | |
if ( isset( $tabs['description']['title'] ) ) | |
$tabs['description']['title'] = $post->post_title; | |
return $tabs; | |
} | |
// Change the description tab heading to product name | |
add_filter( 'woocommerce_product_description_heading', 'wc_change_product_description_tab_heading', 10, 1 ); | |
function wc_change_product_description_tab_heading( $title ) { | |
global $post; | |
return $post->post_title; | |
} | |
?> |
Cool idea! Can’t get it to work though. Still shows “Product Description”..
/**
* Change on single product panel “Product Description”
* since it already says “features” on tab.
*/
add_filter(‘woocommerce_product_description_heading’,
‘isa_product_description_heading’);
function isa_product_description_heading() {
return __(‘Service Description’, ‘woocommerce’);
}
It works! I copy-paste the second function in functions.php file in my child theme and done.
You solve my problem in 5 minutes. Thank you
Can yut tell me please, how i can change the heading of review content. Not the tab title. woocommerce_product_reviews_heading not working. thank you.
How would I change the description tab heading to say “product name description” rather than just product description or just the product name?
Thank you Mr. Gerhard. I hope it improves SEO for my website.
Hi Gerhard,
Great Post, works really well!
If I wanted it to say “Awards” instead of the product title – would this be possible?
Which bits of the code do I need to change?
Many thanks for your advice.
Mandy
Hi Mandy, you would simply change
$post->post_title;
to'Awards';
Thank You,
You saved a lot of time for me.
Great and useful!
How can I change the description tab heading to product description?
Thank you very much!
Ana
Thank for your share. It’s working very nice
How would we add extra text to it? I would like it to say the product name + ‘overview’ i.e. Event Name overview. I can’t figure out how to add it properly.
0 Pingbacks
Categories
Top Posts & Pages
Instagram
No Instagram images were found.
Get Email Notifications