[Resolved] Display Product Category Description On Woocommerce

Home Forums Support [Resolved] Display Product Category Description On Woocommerce

Home Forums Support Display Product Category Description On Woocommerce

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1258152
    Clark

    Hi,

    I’m using the site Merch from Generatepress. I’m trying to do the SEO for my product category pages.

    I want to put product category descriptions at the top of each product category page. I’m able to add the text when I edit the category page but it says: “The description is not prominent by default; however, some themes may show it.”

    In this case, it’s not prominent as it is not showing on the final website. How do I make the product category description visible?

    Thank you!

    #1258709
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    In “Customize > Layout > WooCommerce”, enable the “Page title” option.

    Then in “Customize > Additional CSS”, find this CSS and remove it:

    .tax-product_cat .woocommerce-products-header {
        display: none;
    }

    Let me know if you need more info ๐Ÿ™‚

    #1259455
    Clark

    Thanks that did the job!

    #1260357
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

    #2512584
    Pascal

    Hi,

    I’m using Merch theme and I would like to have the category description.

    I removed the css .tax-product_cat .woocommerce-products-header {
    display: none;
    }

    and it works fine, however I would like the description to be after the products (not before.)

    #2512828
    David
    Staff
    Customer Support

    Hi there,

    you can use this PHP Snippet to Unhook the product category archive description, and then hook it back in after the shop loop:

    add_action( 'wp', function() {
        if ( is_product_category() ) {
            remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 ); 
            add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 );
        }
    } );

    This doc explains adding PHP:
    https://docs.generatepress.com/article/adding-php/

    #2513136
    Pascal

    Thank you, this is exactly what I wanted. I added this code and the description is now after the products.

    #2513853
    David
    Staff
    Customer Support

    Glad to hear that

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.