Tagged: sidebar, woocommerce
-
AuthorPosts
-
August 29, 2018 at 1:09 am #1002925
I have disabled sidebars on archives in Enfold / Options as I do not want it on any normal archive pages.
However I do wish to show the sidebar on the Shop page – there a way to enable the sidebar on this page only?
Many Thanks.
August 29, 2018 at 10:47 pm #1003290Hey M1000000,
Can we check your web site and maybe also have backend access?
Best regards,
BasilisAugust 29, 2018 at 10:54 pm #1003304Hi Basilis,
Working localhost I’m afraid. It’s a general question though:
Enfold options allow me to disable sidebars on all archive pages but as the Woocommerce shop is also an (product) archive it disables it there too. I wish to show the sidebar on the woocommerce Shop page only and nowhere else (apologies if original wording unclear) – how do I do this?
Thanks, M
August 30, 2018 at 1:41 pm #1003571Hi M1000000,
A product does not use archive template and so that setting should not affect it.
https://cl.ly/bf04c01ea7dc Check this setting if the product is built with the default editor.
Best regards,
VictoriaAugust 30, 2018 at 1:54 pm #1003580Victoria – the Shop page is what I am talking about – otherwise known as Product Archive – this uses the archive template therefore when sidebars are disabled on archive pages they are disabled on the Shop page too.
So I am NOT referring to a single product page, I am referring to the product archive (i.e. the woocommerce Shop page) – hope this is clear.
Afraid the screen grab URL you provided is wrong so unable to view.
August 31, 2018 at 8:26 am #1003954Hi,
Please disable sidebar on archive pages and add this code to the child theme functions.php:
add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2); function avia_change_post_layout($layout, $post_id) { if( is_shop() ) { $layout['current'] = $layout['sidebar_right']; $layout['current']['main'] = 'sidebar_right'; } return $layout; }
to show a sidebar on the shop page. If you want to show a sidebar on product archive pages too use this code:
add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2); function avia_change_post_layout($layout, $post_id) { if( is_shop() || is_product_category() ) { $layout['current'] = $layout['sidebar_right']; $layout['current']['main'] = 'sidebar_right'; } return $layout; }
Best regards,
DudeAugust 31, 2018 at 2:14 pm #1004094Perfect thanks – would be great as an admin option.
September 2, 2018 at 8:17 pm #1004696Hi,
Thank you for your feedback :)
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.