[Support request] Code Snippet code in GP Premium user WP site

Home Forums Support Code Snippet code in GP Premium user WP site

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1382123
    John

    I’m trying to hide the WooCommerce Description tab on the single Products page, without losing its text area that I still wish to continue using to display descriptive text. Tried adding the following into Code Snippets:

    add_action( ‘wp_head’, function () { ?>
    <style>
    .woocommerce-tabs ul.tabs {
    display: none;
    }
    </style>
    <?php } );

    Can you advise exactly (as I’m not a ‘coder’) what correct code I should have used in Code Snippet to achieve this please?

    #1382125
    Leo
    Staff
    Customer Support

    Hi there,

    Copy and paste this code:

    .woocommerce-tabs ul.tabs {
        display: none;
    }

    Using one of these methods:
    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #1383653
    John

    Thanks for your really fast response Leo,

    Since using Code Snippets is not mentioned in the link you provided, should I perhaps deduce from your response that I should not have used my Code Snippet plugin for this?

    Despite not being a ‘coder’ I really do try to read and implement all solutions that GP has already published, before asking for help. The code you have suggested that I copy and paste, was already contained within the code I tried putting inside Code Snippets (as submitted to the forum as not working for me). Just to be sure that Code Snippets was not the solution, I tried putting in only:

    .woocommerce-tabs ul.tabs {
    display: none;
    }

    ….which creates 4 parse errors in the 1st line! So I guess that was a non-starter solution then.

    I followed the link you provided and firstly, if I understand correctly, ‘Additional CSS’ (accessed from WP Dashboard>Appearance>Customise) is not a viable option as I’m not using a child theme and I don’t want the code wiped by any future theme or WC updates.

    The other recommendation from that link was to use ‘Simple CSS’ (accessed from WP Dashboard>Appearance>Customise). I tried this two ways: once with the code added below the pre-existent code text in the Simple CSS box and then with all other code first removed from the box. Neither way implemented the change being sought.

    Pre-existent text in the box had been:
    .text-box {
    padding: 3px 3px;
    background-color: rgba(240,240,240,0.75);
    }
    /* remove category */
    .single-product .product .product_meta span.posted_in {
    display: none;
    }
    /* remove “Description” h2 from description tab */
    .woocommerce-tabs #tab-description h2 {
    display: none;
    }

    Sorry if I’m being dim but please advise if I’m missing something in my implementation of your answer?

    N.B. BTW, in case it impinges on your answer, the solution needs to allow me to retain the existing ‘Full description —>’ and link it to my ‘hopefully-in-future’ untabbed ‘Description’ text area.

    #1383794
    David
    Staff
    Customer Support

    Hi there,

    Edit that CSS to include the !important statement like so:

    .woocommerce-tabs ul.tabs {
        display: none !important;
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.