-
AuthorPosts
-
February 8, 2022 at 12:08 pm #1339578
Hello, I would like to remove the ‘description’ title in Woocommerce product page. (Beschrijving.) You can see now that the word ‘Beschrijving’ is shown twice and this is too much. Can I remove the second word Beschrijving?
February 8, 2022 at 2:24 pm #1339616Hey EricSmeets,
Please try this code in the General Styling ▸ Quick CSS field or in the WordPress ▸ Customize ▸ Additional CSS field:#top.single-product #wrap_all .woocommerce-tabs h2 { display: none; }
After applying the css, please clear your browser cache and check.
Best regards,
MikeFebruary 8, 2022 at 2:27 pm #1339617Perfect, thanks! And is it also possible to change this text into the H1 head of the page name? In the example image here I manually typed MaxiSys MS906. But is it possible to use the H1 head for all products?
- This reply was modified 2 years, 10 months ago by EricSmeets.
February 9, 2022 at 8:39 am #1339717Hi,
Thank you for the update.
The product title is already an h1 element. You can check its actual html below.
<h1 class="product_title entry-title">Update abonnement | 1 jaar</h1>
Best regards,
IsmaelFebruary 9, 2022 at 10:19 am #1339753Yes I understand that. But is there no such code like this:
#top.single-product #wrap_all .woocommerce-tabs h2 { display: product_title entry-title }
In other words that the product title gets shown instead of the original word ‘Beschrijving’?
February 9, 2022 at 2:13 pm #1339800Hi,
I’m not sure that I understand what you are looking for, the product title at the top of the page is already an H1 MaxiSys MS906
and you would not want more than one H1 tag on a page.
But if you want to replace the Beschrijving text with the product title text and not the H1 tag
Try adding this code to the end of your functions.php file in Appearance ▸ Editor:function replace_product_Description_with_title() { ?> <script> (function($){ var text = $('#top.single-product #wrap_all h1.product_title.entry-title').text(); $('#tab-title-description a').text(text.replace('Beschrijving', text)); })(jQuery); </script> <?php } add_action('wp_footer', 'replace_product_Description_with_title');
Best regards,
MikeFebruary 9, 2022 at 2:42 pm #1339816Hello Mike,
sorry for me making not clear what I want. Your code works perfectly, but I want it a little bit different.
Please have a look at the image here:I want the h1 of the productpage (“Thermisch printpapier voor BT608” for this specific product) to be also visible at the location where now “Tekst 1” is written. So I don’t want to have the word “Beschrijving” replaced.
- This reply was modified 2 years, 10 months ago by EricSmeets.
February 9, 2022 at 2:49 pm #1339820Hi,
Thanks, I see that the Tekst 1 is added text, so while that text could be replaced with the product title, it doesn’t seem logical to add text or shortcode to be replaced when you could just as easily add the product title in the first place, do you see what I mean?Best regards,
MikeFebruary 9, 2022 at 2:51 pm #1339821Hi Mike, I don’t think I understand. What I want is to have the product title at that spot without having to add it manually every time with every product.
The text “Tekst 1” can of course be deleted, that was just to show the location where the product title had to be copied to.February 10, 2022 at 3:31 am #1339881Hi,
Please remove the script above and the css above that hid the h2 tag and add this code to the end of your functions.php file in Appearance ▸ Editor:function add_product_title_to_description_tab() { ?> <script> (function($){ var text = $('#top.single-product #wrap_all h1.product_title.entry-title').text(); $('#tab-description h2').text(text.replace('Beschrijving', text)); })(jQuery); </script> <?php } add_action('wp_footer', 'add_product_title_to_description_tab');
Best regards,
MikeFebruary 15, 2022 at 5:14 pm #1340749Yes!!!! You’re the best. Thanks Mike!
-
AuthorPosts
- The topic ‘Remove 'description' title in Woocommerce’ is closed to new replies.