- This topic has 6 replies, 2 voices, and was last updated 1 month, 3 weeks ago by Fernando.
September 29, 2022 at 12:21 am #2357288Kaan
We are using GP for our Woocommerce site. We are trying to change widgets on shop page;
1) To add a new horizontal widget above product list on shop/archive pages
2) To differentiate right sidebar widgets for shop page and blog page (to display product related widgets on shop page side bar and post related widgets on blog list page)
For adding widgets on top (1) I tried your proposed solution on topic->https://generatepress.com/forums/topic/add-widget-at-the-top-of-a-page/#post-1860900 but this hook only adds right bar widget on top even if I change side-bar ID in the snippet (ie <?php get_sidebar( ‘left-sidebar’); ?>)
I planned to use an unused widget such as Footer 4 or 5 and tried to display it on top but I think I am missing something.
For (2) I could not find a way to use Elements for serving different widgets on shop and blog list pages. Our layout is content+sidebar for both pages.
Could you please give me a direction for these customizations.
KaanSeptember 29, 2022 at 1:24 am #2357351Fernando Customer Support
For reference, can you provide the link to the page in question? We’ll take a look at how it looks like now.
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-informationSeptember 29, 2022 at 2:14 am #2357402Kaan
Thank you for your prompt reply.
In the mean time, I have further worked on the issue. Now, I added widgets to right sidebar and via CSS I put them on the top for mobile. (So product filters are on the right on desktop, on the top on mobile) which is acceptable.
You can check current page view at https://stage.coffeetropic.com/kahveler/
What I need now is to differentiate right side bar widgets for blog list page. Since at the moment product filter widgets are displayed on blog page, too. I want to display different widgets for blog page.
You can check blog page at https://stage.coffeetropic.com/blog/
KaanSeptember 29, 2022 at 3:46 am #2357463Kaan
I have worked on blog page. I used left sidebar on blog page and via the same CSS trick I displayed left sidebar on the right on desktop and hide it on mobile. So using these workarounds I achieved different sidebars on shop and blog pages.
However, it would still be good to be able to put different sidebars on shop and blog via theme settings. You may consider this improvement for your next releases.
KaanSeptember 30, 2022 at 1:46 am #2358514Fernando Customer Support
Doing so would be possible now. You’ll need to add the widgets through a Block Element – Hook. There are hooks:
after_left_sidebar_content before_left_sidebar_content after_right_sidebar_content before_right_sidebar_content
You can then set the Display rule of the Block Element so that it appears only on your preferred pages.
Using a Block Element – Sidebar would be a possible solution as well so that it’s a totally different sidebar: https://docs.generatepress.com/article/block-element-sidebar/October 18, 2022 at 7:13 am #2377469Kaan
I implemented using Block Elements -Hook and it was possible to differentiate sidebars in different pages.
I mark this topic as resolved.October 18, 2022 at 4:51 pm #2378155Fernando Customer Support
You’re welcome Kaan!
- You must be logged in to reply to this topic.