WordPress.org

Support

Support » Plugins and Hacks » Trying to remove sidebar from all Woo commerce Pages

Trying to remove sidebar from all Woo commerce Pages

  • I created a woocommerce.php file and replaced my theme’s loop with//
    <?php woocommerce_content(); ?>
    It worked perfectly! My sidebar was then placed in the correct position.

    My issue is what it seems to be an invisible sidebar…
    I would like my WooCommerce pages to be full width.
    But each page template seems to have a huge gap on the right hand side (where my sidebar once was)

    I basically would really LOVE to find out what I can do in order to make all Woo Pages full width.

    I will paste whatever code needed in a pastebin, just not sure which, so please let me know!

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

Viewing 15 replies - 16 through 30 (of 44 total)
  • As long as your running the newest version of woocommerce it will work. Also keep a backup of your original file before you edit them just in case so that you can restore it back if something goes wrong.Make sure you do the edit in your themes stylesheet or it will only show the main content for half the page. If you need any help let me know.

    If you forget to make backups of your files just download woocommerce again extract it and then take the files out.

    Hi. Been doing searches for this specific issue of mine with no satisfactory results. I hope I am in the right place for this. If not, my apologies. Issue: When logged in as any user and I go to the “my account” page in the woocommerce, my sidebar gets an additional widget that has the following: change password, edit my address, logout, lost password and view order.

    What I would like to do is be able to take out the “lost password”. Being as the user is logged in already, to me, it would make sense that you would not need to do this. So I guess my question is, where is the code for this “ghost widget” that I cannot seem to find. I have performed several different types of searches inside the “woocommerce” plugin folder and any changes i have done seem to have no effect on the output. I am confident that when I do find the code that I will be able to correct this myself. I just cant find it. Thanks in advanced for any advise.

    Ok, so the power of writing to people has opened my mind once again. Just realized that this “ghost widget” of mine is listing the “sub-pages” under the “my account” page. So while I have solved my issue in “hidding” the “lost password” option, I still would like to know where this code is getting inserted at. Once again, thanks for any advise.

    Hello kwatts22 and others,

    I have done the first two steps of what you suggested (the single-product.php and the archive-product.php)

    but I am stuck on the third

    next we have to edit the style.css in your theme folder
    find
    #content-woocomerece
    add the following before the } tag on the last line
    width:100%;

    NOTE: You can not add the /* */ to the line it will not comment it out.

    What style.css file to I edit? I have relatively new to WP and have created a child them based on the Twenty Eleven theme. I have looked in the Twenty Eleven child theme and the original Twenty Eleven them and I can’t see any line that contains “#content-woocomerece”

    Any assistance would be gratefully received.
    Peter Evans

    hi evanspj post a link to your website

    zfields

    @zfields

    I’m also not seeing that last line in part 3 Kwatts22.

    Using one of the actual woocommerece themes. Honestly at this point thinking about just dumping woocommerece, doesn’t seem nearly as “flexible” as they claim at this point.

    evanspj

    @evanspj

    Hello kwatts22,

    Thanks for your speedie reply but i am not sure where to look for your comment … could you either post it here or use the contact form on emarkingassistant.com

    thanks for your assistance,
    Peter Evans

    evanspj

    @evanspj

    kwatts22,

    Opps I did not fully read your last post … here is a link to a sample product page that I would like to extend 100% of the width of the window.
    http://emarkingassistant.com/product/sample-product-only/

    I would like to remove the side bar from all the woocommerce pages.

    I have added

    #content-woocommerce {
    width: 100%;
    }

    to the style.css in my child theme but the content still does not extend 100% of the window.

    I have commented out the relevant lines in single-product.php and archive-product.php and the sidebar no longer appears on the page.

    Thanks in advance for any assistance,
    Peter Evans

    kwatts22

    @kwatts22

    Hi Evan,

    I am looking at the site right now.

    kwatts22

    @kwatts22

    I got a answe for you edit your style.css located in wp-content/themes/twentyeleven

    on line 90 you will see the following

    #content {
    	margin: 0 34% 0 7.6%;
    	width: 58.4%;
    }

    change that to this

    #content {
            margin: 0 auto;
            width: 90%
    }

    kwatts22

    @kwatts22

    That will leave room for the other pages that still use the sidebar

    evanspj

    @evanspj

    kwatts22

    Yes. If I add

    #content {
            margin: 0 auto;
            width: 90%
    }

    to the style.ccs I can see that it will extend the content area on the product page the full width of the window … and this is GOOD.

    But I still want the sidebar to show on the other pages on my site. Is there a way to hide remove the sidebar on only the woocommerce pages and still have it shown on the other pages of my site?

    I can use WIDGET AREAS to control what area is shown on the pages but the content area still does not extend 100% of the width even if nothing is in new area.

    Peter

    Peter

    kwatts22

    @kwatts22

    here is a workaround because your using the twenty eleven theme which don’t have a full width temple without the sidebar.

    Create a file in wp-content/theme/twentyeleven and name it woocommerce.php

    add this to it

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    get_header(); ?>
    
    		<div id="primary">
    			<div id="content-fullwidth" role="main">
    
    			<?php woocommerce_content(); ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>

    then in your style sheet located in the same folder add on line 94

    #content-fullwidth{
        margin-left: 20px;
    	width: 90%;
    }

    The new page template for woocomerce will now use a container-fullwidth which will take the whole page instead of only half and will only work on the woocommerce pages.

    kwatts22

    @kwatts22

    You can change the margin-left and the width to suite your needs.

Viewing 15 replies - 16 through 30 (of 44 total)
  • The topic ‘Trying to remove sidebar from all Woo commerce Pages’ is closed to new replies.