Archived topic
The word description appearing twice (WC)
7 replies · Started by SLIM on July 23, 2021
While this has been covered on several posts, everyone is removing the TABS.
I actually want to keep the tabs. I noticed even on GeneratePress regular tutorials the word DESCRIPTION is there twice:
https://docs.generatepress.com/article/woocommerce-overview/#single-product
Description (tab)
Description (h2 header)
I tried doing h2 display non, but this is not a good solution as it removed ALL h2 headers in the product tab. While i can work around this, I really think GP should have a option to fix this.
I want to keep the TABS (as i have multiple tabs) and like that functionality. But not have it repeat the title of the tab in the description.
Hi there,
you can add this PHP Snippet:
add_filter( 'woocommerce_product_description_heading', '__return_null' );
How to add PHP: https://docs.generatepress.com/article/adding-php/
Thank you so much.
For anyone else reading this: If you're like me and don't want to install YET another plugin. You can do this through ELEMENTS > add hook > Header > Tick Execute PHP > Set the LOCATION to PRODUCT.
<?php
add_filter( 'woocommerce_product_description_heading', '__return_null' );
?>
Glad to hear thats working.
I wouldn't recommending using a Hook Element for add_filter functions. The Hook Element was built for adding content to front end templates. And filters are best registered before the template is executed. Using this method may lead to 'problems' or it not working at all in the future.
Child themes are the best way to go. I would recommend using one with Woocommerce as common customizations ( such as changing the default Order Email templates ) will require one.
I see, if there is a problem in the future, i'll change it over to the snippets plugin or just manually edit code. For now - I guess since i have the location set to that one single page it's not causing any issues.
Thank you.
Feel free to close this topic :)
Glad to be of help
Thank you very much it worked.
Glad to hear that!