[Resolved] Is it possible to create a new widget area?

Home Forums Support Is it possible to create a new widget area?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1347937
    Alfonso

    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.

    #1348031
    David
    Staff
    Customer Support

    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.

    #1348183
    Alfonso

    Hi.
    Thank you very much.
    It’s just what i was looking for.
    Best regards.

    #1348437
    David
    Staff
    Customer Support
    #1609728
    Catherine

    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

    #1609769
    David
    Staff
    Customer Support

    Hi there,

    are those widgets available as shortcode / PHP function ? Or are they only WP Widgets?

    #1609824
    Catherine

    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?

    #1609934
    Leo
    Staff
    Customer Support

    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!

    #1610233
    Catherine

    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.

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