[Resolved] Woocommerce: How can I add a block of text on product category pages?

Home Forums Support [Resolved] Woocommerce: How can I add a block of text on product category pages?

Home Forums Support Woocommerce: How can I add a block of text on product category pages?

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1132308
    David Bennett

    In a WooCommerce site I want to be able to add a block of text below the product thumbnails on the category pages.

    I can display text above the products on the category page by entering it in the Description field for the Product category (see URL).

    That looks OK for displaying one or two lines of text, but not for displaying a few paragraphs because it pushes the product images too far down the page.

    How can I add a new section, a block of text below the thumbnails?

    #1132363
    Leo
    Staff
    Customer Support
    #1132766
    David Bennett

    Thanks. I get the idea.

    Now that I have a practical reason to learn, I am finally learning how to use hooks, and create actions and filters.

    I will mark this as resolved.

    #1133112
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #1134398
    David Bennett

    I have a follow-up question.

    In WooCommerce/Product/Category in the back end, or Posts/Category in any WP site, there is a statement below the description field that reads “The description is not prominent by default; however, some themes may show it.”

    Generate Press does show the description on the front end.

    What is the code or the controlling feature in Generate Press that causes the description to show on the front end?

    #1134500
    Leo
    Staff
    Customer Support

    Does the Display short description option in the customizer help?
    https://docs.generatepress.com/article/woocommerce-overview/#shop

    #1134520
    David Bennett

    I turned off all the options and the line of text I added in the Product/Category/Description field still shows.

    #1134525
    Leo
    Staff
    Customer Support

    Sorry are you wanting to hide the sentence “Make that anniversary an extra special one with our range of gorgeous greeting cards all perfect for the occasion.” in the URL provided?

    Let me know πŸ™‚

    #1134528
    David Bennett

    Sorry, no. What I want to be able to do is to make another block of text that will appear below the thumbnails and the pagination. I am looking into hooking into that section of the page but it is beyond my skill level for now.

    In trying to understand how it works, I wondered why the line of text in the standard description is visiable and shows in the front end with the Generate Press theme.

    What I mean is that there must be some reason why the WordPress statement about the text not showing (β€œThe description is not prominent by default; however, some themes may show it.”) is there? How do some things show it and other themes not show it?

    #1134605
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It’s likely because GeneratePress does this: https://github.com/tomusborne/generatepress/blob/2.4.1/inc/structure/archives.php#L103

    It looks for a term description (any term, like categories or product categories), and displays it.

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

    #1135037
    David Bennett

    Thank you. πŸ™‚

    #1135456
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

    #1135458
    David Bennett

    I have managed to do it using Advanced Custom Fields and a PHP snippet. The only thing left to do is to exclude the text appearing on product category pages for page 2, page 3, etc

    Somewhere in my reading I found a reference to a filter (I think it was) to exclude subsequent pages. Still hunting for where I read it.

    Any help on how exclude pages beyond page 1 ?

    #1135626
    Leo
    Staff
    Customer Support
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.