Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #14054

    My site uses a right sidebar by default. However, I need a left sidebar for the shop pages.

    If I set the Default Page Layout under Theme Options to “Left Sidebar”, my shop sidebar displays correctly on the left. However, now ALL of the pages on my site have a left sidebar instead of just the shop pages.

    If I set the Default Page Layout to “Right Sidebar” my site pages are good but my shop pages are wrong.

    I believe the answer is to keep the Default Page Layout set to “Right Sidebar” so that my site pages appear correctly and to somehow override this setting for the shop pages. The question is, how do I do this?

    I am happy to hard code this setting for the shop pages if someone can direct me to the appropriate place in the theme or woocommerce codebase.

    Thanks for your help.

    #81886

    Try following – open up sidebar.php and replace:

    if(strpos($avia_config['layout'], 'sidebar_left')  !== false) $sidebars_to_show = array('left');
    if(strpos($avia_config['layout'], 'sidebar_right') !== false) $sidebars_to_show = array('right');
    if(strpos($avia_config['layout'], 'dual-sidebar') !== false) $sidebars_to_show = array('left','right');

    with:

    if(strpos($avia_config['layout'], 'sidebar_left')  !== false) $sidebars_to_show = array('left');
    if(strpos($avia_config['layout'], 'sidebar_right') !== false) $sidebars_to_show = array('right');
    if(strpos($avia_config['layout'], 'dual-sidebar') !== false) $sidebars_to_show = array('left','right');
    if(is_shop()) $sidebars_to_show = array('left');

    #81887

    Awesome. Worked like a charm. You guys are great!

    #81888

    Oops, I spoke to soon. Your solution works well for my main shop page but isn’t working for my product category pages.

    http://i569.photobucket.com/albums/ss131/michaelspencer/ScreenShot2012-07-20at15934PM.png

    Any ideas?

    #81889

    Hi,

    Try using this

    if(strpos($avia_config['layout'], 'sidebar_left')  !== false) $sidebars_to_show = array('left');
    if(strpos($avia_config['layout'], 'sidebar_right') !== false) $sidebars_to_show = array('right');
    if(strpos($avia_config['layout'], 'dual-sidebar') !== false) $sidebars_to_show = array('left','right');
    if(is_shop()) $sidebars_to_show = array('left');
    if(is_product_category()) $sidebars_to_show = array('left');

    Regards,

    Ismael

    #81890

    Thanks. And yes, I tried that option before posting here, but no joy. Any more ideas?

    #81891

    Hello,

    Try to change this bit of code

    if(is_product_category()) $sidebars_to_show = array('left');

    to something like

    if(taxonomy_exists('product_cat')) $sidebars_to_show = array('left');

    Regards,

    Ismael

    #81892

    Sorry but that’s not working either. If you let me know how to send you the login details for my site, you can take a look at it yourself.

    #81893

    Still struggling to resolve this issue with the positioning of the sidebar on my shop category page.

    The solution described above works well on my shop overview page but on the shop category pages the sidebar is floating to the bottom of the page below the products. As a reminder, I need my Default Page Layout set to “right sidebar” but I want to override this and have a left sidebar on ALL shop pages.

    I stumbled upon this support thread and tried the suggested fix but this didn’t work either – http://www.kriesi.at/support/topic/sidebar-not-floating-correctly-on-shop-page

    Thanks for your help.

    #81894

    Hey,

    Please send your admin details to (Email address hidden if logged out) . Don’t forget to include this thread.

    Regards,

    Ismael

    #81895

    I sent you the email yesterday. Please confirm that you received it. Thanks.

    #81896

    I’ll tag this topic for Ismael just in case he never received the email.

    Regards,

    Devin

    #81897

    Thanks Devin. Much appreciated.

    #81898

    Hi Michael,

    Ismael reported in the other thread you have going that he was still working on the issue. Still keeping him tagged to this thread as well. :)

    Regards,

    Mya

    #81899

    Hi Mya and Ismael,

    Just checking on the status of this. It’s been a month since I first posted this issue and I still don’t have a working solution. Would really appreciate if we could get this resolved in the next couple of days. Thank you.

    Best,

    Michael

Viewing 15 posts - 1 through 15 (of 15 total)

The topic ‘Override Sidebar Position for Shop Pages’ is closed to new replies.