• Resolved kristinubute

    (@kristinubute)


    Hi

    I don’t need a left sidebar at all for this client website.

    I have tried different coding in functions.php but nothing seems to remove it.

    I found this in google but didn’t work:

    function iconic_remove_sidebar( $is_active_sidebar, $index ) {
    if( $index !== “sidebar-1” ) {
    return $is_active_sidebar;
    }

    if( ! is_product() ) {
    return $is_active_sidebar;
    }

    return false;
    }

    add_filter( ‘is_active_sidebar’, ‘iconic_remove_sidebar’, 10, 2 );

    Can someone offer some coding for help please ?

    Thanks
    Kristin

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter kristinubute

    (@kristinubute)

    And have it 100% width.

    Thomas Shellberg

    (@shellbeezy)

    Automattic Happiness Engineer

    @kristinubute – the sidebar should be dynamically removed provided there are no active widgets on the site. Try going to Appearance->Widgets and deleting your active widgets.

    Thread Starter kristinubute

    (@kristinubute)

    HI

    There is NO delete button in the widgets area where it says “Sidebar” that I can see.

    How do I delete it ?

    Thx
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    I have found a function coding whilst googling to get an answer and seems to work

    function iconic_remove_sidebar( $is_active_sidebar, $index ) {
    if( $index !== “sidebar-1” ) {
    return $is_active_sidebar;
    }

    if( ! is_product() ) {
    return $is_active_sidebar;
    }

    return false;
    }

    add_filter( ‘is_active_sidebar’, ‘iconic_remove_sidebar’, 10, 2 );

    ONLY issue is that my products are ONLY still showing 3 products across the screen and I need 4 or 5 products showing…

    As default for Storefront seems to be 3, I have tried several bits of coding to make it show 4 or 5 columns or products but no luck .. still showing 3

    I usually use this in functions but not working.

    /*adjustment for 4 shop columns*/
    add_filter( ‘storefront_loop_columns’, function() { return 4; } ); //change shop colunns//

    Any help would be appreciated
    This is frustrating.

    Thx
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    Not sure whether that coding above is 100% correct seems to do the job in removing the sidebar, but still having display issues like the Single Product Page seems to have a gap still for left Sidebar .. so I don’ think that is the exact right coding to use.

    And the view on the 15″ lcd compared to 23″ lcd doesn’t look same either (on the 15″ still seems to have a gap on left hand side but when viewing on 23″ larger screen seems to look only because bigger screen I assume .. so still not right

    Any help greatly appreciated

    Thx
    Kristin

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    You can specify the number of products and rows under Appearance > Customize > WooCommerce > Product Catalogue.

    As for the main column not taking up 100% of the space, this is due to it is designed to have a sidebar. If the sidebar is already removed, this CSS should take care of making the product archive pages full width:

    @media ( min-width: 768px ) {
    	.post-type-archive-product #primary {
    		width: 100%;
    		margin-right: 0;
    	}
    }

    If you need all pages to be full width, you can remove .post-type-archive-product from the rule.

    Thread Starter kristinubute

    (@kristinubute)

    Hi

    That worked great actually !

    Thanks for that

    With regards to the other issue, my Woocommerce is up to date and the WordPress version.

    When I go to specify the number of products and rows under Appearance > Customize > WooCommerce > Product Catalogue.

    There is NO option to show to SPECIFY number of products – doesn’t show up.

    Any other suggestion or coding ?
    It is only still showing 3 products on each row.
    Which I require 4 or 5 ….

    Thanks
    Kristin

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @kristinubute) Have you added a filter into your child theme using the loop_shop_columns filter? If so, this would be the reason this option is not showing. If the theme or child theme specifies the number of items per row, then the Customizer options are removed.

    Thread Starter kristinubute

    (@kristinubute)

    Hi

    Sorry I don’t know anything about a loop_shop-columns so I haven’t changed any coding for this.

    Any other ideas ?

    Thanks
    Kristin

    Fernando a11n

    (@fhaps)

    Automattic Happiness Engineer

    Hi @kristinubute, it’s strange that the option to control the number of rows and columns is not in the customizer if the theme files have not been modified.

    There are a couple of things that you could try in this situation:

    1. Try installing Storefront once again, from scratch and directly from the www.remarpro.com repository, to confirm that the files are uncorrupted.

    2. Test for any plugin conflicts that might be preventing these options from appearing. To do this, you’d have to disable all plugins except for WooCommerce – and check to see if the options appear then.

    Hope this helps!

    Thread Starter kristinubute

    (@kristinubute)

    Hi

    If I reinstall Storefront, what is the best method ? Do I uninstall the original firstly then install new ? Do I lose my settings and everything in there … As I don’t want to do all my CSS coding again, and all the headers etc.

    Thanks
    krsitin

    Fernando a11n

    (@fhaps)

    Automattic Happiness Engineer

    @kristinubute That’s right. You’ll first need to delete the current copy of the theme on your site, and then proceed to install it again.

    Theme settings are saved in the database, so they shouldn’t be affected when removing the theme and installing it again. However, I would highly recommend that you only make these changes after having saved a recent backup of your site, and a copy of the CSS code that you have written.

    That way, if something goes wrong during the installation, you can always go back to the last backup you saved.

    Thread Starter kristinubute

    (@kristinubute)

    Hi

    I have this coding in the style-css file

    @media (min-width: 768px){
    .col-full {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding: 0 4em;
        box-sizing: content-box;
    }
    
    /*adjustment for 4 shop columns*/
    .site-main ul.products li.product {
        width: 16% !important;
        float: left;
        margin-right: 2%;
    	    margin-left:0;
    }

    Which seems to be OK except it only shows 3 products on each row. It will be a simple CSS code I think to push the products on the 2nd row to move up to the end of the first row in this area .site-main ul.products li.product {

    I thought the margin-left: 0; would work but didn’t.

    Thanks
    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    And I have updated Storefront theme made no difference.

    Can I possibly email you privately the login details to the site to see ?

    Kristin

    Thread Starter kristinubute

    (@kristinubute)

    It is also strange as you mention I should be able to change the settings in the theme Customiser: Specify the number of products and rows under Appearance > Customize > WooCommerce > Product Catalogue.

    This area shows :

    Shop Page Display and drop down
    Category Display and drop down – Show Categories or Sub-Categories or both …
    Default Product Sorting

    That’s it …

    On 3 of my recent client sites with all updated plugins, themes and Woocommerce none of them show this setting that you are referring to.

    Thx
    Kristin

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How to remove left sidebar entirely from site’ is closed to new replies.