[Resolved] Sidebar's Layout for Woo's "Shop" page

Home Forums Support [Resolved] Sidebar's Layout for Woo's "Shop" page

Home Forums Support Sidebar's Layout for Woo's "Shop" page

  • This topic has 7 replies, 4 voices, and was last updated 7 years ago by Tom.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #206490
    Dmitry Bychenko

    hi, guys,

    ive faced a problem when i cant change Sidebar Layout on WooCommerce’s page “Shop”.
    WooCommerce creates 4 pages by default:

    Cart
    My Account
    Checkout and
    Shop

    For pages Cart, My Account and Checkout it is possible to change default Layout,
    https://www.dropbox.com/s/ayyxrl5n4nn9o5b/Woo-Shop.jpg?dl=0

    but for Shop Page change Layout is not possible.
    Whatever checkbox i choose, the result is always default Layout.

    Is that possible to overwrite rules for this page?
    for example, using Simple CSS plugin

    #206497
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You need to use the sidebar filter for the shop page.

    More info here: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#sidebar-filter

    #220089
    Shane

    Hello,

    I’m working on an issue like this as well. I’ve added the code snippets plugin and tried adding the php code recommended in your link to show no sidebar on woo commerce category pages but nothing seems to happen.. I know how to modify css stylesheet a bit but never really played with php, guess it’s time I learn! In fact I’d like to get the sidebar to not display at all on any woo commerce pages. Home, categories, products or cart. Is there any easy way to accomplish this? I am using the generate press child theme. Here is site on temp domain:
    http://9bd.b89.myftpupload.com/

    Thanks!

    #220127
    Tom
    Lead Developer
    Lead Developer

    Can you show me the PHP snippet you’re using?

    #220134
    Shane

    This is what I put into code snippet. Didn’t seem to bring any change.

    add_filter( ‘generate_sidebar_layout’,’generate_custom_category_sidebar_layout’ );
    function generate_custom_category_sidebar_layout( $layout )
    {
    // If we are on a category, set the sidebar
    if ( is_category() )
    return ‘no-sidebar’;

    // Or else, set the regular layout
    return $layout;

    }

    #220231
    Tom
    Lead Developer
    Lead Developer

    Instead of: is_category()

    You want: is_woocommerce()

    Make sure WooCommerce is activated first πŸ™‚

    #309414
    naisyo523

    This (https://docs.generatepress.com/article/sidebar-layout/#sidebar-filter) is wonderful! Just want to thank you for making these πŸ™‚

    #309465
    Tom
    Lead Developer
    Lead Developer

    I agree! I love filters πŸ™‚

    Glad you’re enjoying them as well!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.