- This topic has 13 replies, 3 voices, and was last updated 1 year ago by Leo.
January 14, 2020 at 3:21 pm #1132308David 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?January 14, 2020 at 5:02 pm #1132363LeoStaffCustomer Support
You will need to use a hook from WooCommerce itself:
https://docs.woocommerce.com/document/introduction-to-hooks-actions-and-filters/January 15, 2020 at 5:04 am #1132766David 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.January 15, 2020 at 8:38 am #1133112LeoStaffCustomer SupportJanuary 16, 2020 at 11:38 am #1134398David 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?January 16, 2020 at 2:50 pm #1134500LeoStaffCustomer Support
Does the Display short description option in the customizer help?
https://docs.generatepress.com/article/woocommerce-overview/#shopJanuary 16, 2020 at 3:01 pm #1134520David Bennett
I turned off all the options and the line of text I added in the Product/Category/Description field still shows.January 16, 2020 at 3:03 pm #1134525LeoStaffCustomer 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 🙂January 16, 2020 at 3:09 pm #1134528David 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?January 16, 2020 at 6:15 pm #1134605TomLead DeveloperLead Developer
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 🙂January 17, 2020 at 6:47 am #1135037David Bennett
Thank you. 🙂January 17, 2020 at 11:26 am #1135456TomLead DeveloperLead DeveloperJanuary 17, 2020 at 11:29 am #1135458David 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 ?January 17, 2020 at 5:23 pm #1135626LeoStaffCustomer Support
I believe this is what you are looking for:
See some examples here:
- You must be logged in to reply to this topic.