WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] How to set the Sidebar? (7 posts)

  1. rjt1985
    Member
    Posted 1 year ago #

    I've just installed Woocommerce into my website and it's working great apart from one thing...

    Sidebars!

    How do I set which Sidebar the Shop page and other WooCommerce pages use?

    As part of my theme I can create an unlimited number of sidebars, which I then assign by going to the relevant page, but on WooCommerce pages this doesn't work.... it just displays the Default sidebar.

    How can I change this?

    (I am building a website that is for the most part a blog, with a shop tagged on the end, so I definitely need different sidebars for Blog pages compared to Shop/Product pages)

    http://wordpress.org/extend/plugins/woocommerce/

  2. rjt1985
    Member
    Posted 1 year ago #

    Any help with this would be massively appreciated.

    It seems like it is always picking up the default / archive sidebar rather than picking up a one that I specify. I've even tried copying my theme's page.php file and calling it woocommerce.php and swapping out the loop for <?php woocommerce_content(); ?> but that still results in the same sidebar appearing no matter what.

    Surely there must be a way to hardcode which sidebar I want to display?

  3. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    The WooCommerce shop page is not a page, it is a post type archive. That probably explains why you cannot set a custom sidebar.

    If your theme allows you to set a custom sidebar for post types then that is how you should do it. Seems like a strange piece of functionality to include in a theme though.

    Alternatively you could create a sidebar-shop.php file, or look at our WooSidebars plugin.

  4. rjt1985
    Member
    Posted 1 year ago #

    Thanks. The WooSidebars plugin seems to have worked.

  5. Troy Templeman
    Member
    Posted 8 months ago #

    @jameskoster with that said, you should be able to override the template being used for the shop page with a custom template. I tried archive-product.php but doesn't work. Do you know what the name of the template should be?

  6. jameskoster
    Member
    Plugin Author

    Posted 8 months ago #

    archive-product.php should do it.

  7. Gabster1501
    Member
    Posted 8 months ago #

    Is there any detailed documentation on that? All I read is "use this file or this file" but I dont get whyt to change there. I have set up a woocommerce.php. Now whats the next step?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic