Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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?

    #1339616

    Hey 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,
    Mike

    #1339617

    Perfect, 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.
    #1339717

    Hi,

    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,
    Ismael

    #1339753

    Yes 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’?

    #1339800

    Hi,
    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
    2022-02-09_001.jpg
    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
    2022-02-09_002.jpg
    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,
    Mike

    #1339816

    Hello 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.
    #1339820

    Hi,
    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,
    Mike

    #1339821

    Hi 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.

    #1339881

    Hi,
    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,
    Mike

    #1340749

    Yes!!!! You’re the best. Thanks Mike!

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Remove 'description' title in Woocommerce’ is closed to new replies.