Archived topic
Is it possible to create a new widget area?
9 replies · Started by Alfonso on July 1, 2020
Goog morning.
I would like to know if a new widget area can be created. I would like to insert in my ecommerce a text and a photo on the category pages just below the category title. In my previous theme I did it by creating a new widget and placing it in the archive-product.php file in the position I wanted, and using a plugin it showed a different text and a photo for each category.
In this topic can it be done this way or is there some other way to do it?
Best regards.
Hi there,
you can use Hooks to add elements and content to the theme templates.
For Woocommerce you can see all the available hooks here:
https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/
And the easiest way to use them is the Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
GP includes the list of all the Woo hooks.
let us know if that helps.
Hi.
Thank you very much.
It's just what i was looking for.
Best regards.
Glad to be of help
Hi,
I'm looking to add a widget at the end of post/page content and wonder if this uses the 'generate_after_entry_content' hook? I don't want the widget to show up in on the blog page, nor archives etc., just the content itself.
*edit*: would it actually be better to place it above 'generate_before_footer' hook? Would this produce less calls to the database and be a more efficient way to place a global widget for email sign ups, for example. I would still like to be able to add one at the end of a post for other purposes.*close edit*
I assume it would not matter how many widgets were used in this new area and that it would still be subject to the Jetpack visibility options?
Many thanks,
Catherine
Hi there,
are those widgets available as shortcode / PHP function ? Or are they only WP Widgets?
I'm looking to place a global email sign up at the end of each post. I'm also looking to add a widget to certain posts, again at the end of content - book promos etc.
So the book promos would be custom html widget, Mailchimp already exists in the widget area. I think the Mailchimp sign up widget must be php? If that's what you mean?
The easiest method would be to use a plugin like this:
https://en-ca.wordpress.org/plugins/widget-shortcode/
Then you can use the shortcode generated with hooks elements.
Please open a new topic if you need more help on this.
Thanks!
Thanks, though I found a plugin that creates a widget area after the content. Got my Mailchimp connect and their widget is sitting in there just fine.
No problem :)