WordPress woocommerce plugin changing theme layout

I am developing a woocommerce related theme and issue I am facing is that when ever I go to shop page or any page it changes my layout. It removes my .container class and convert that class to #container id and so my 1170px layout is not showing up and all my data is 100%.

I am new to woocommerce kindly guide me how to fix this?

Read More

My container class is working fine on all other pages instead woocommerce.

Related posts

Leave a Reply

2 comments

  1. Yes, I got it by my self. That was due to just because I was showing posts from WooCommerce Plugin templates and that’s default behavior of the WooCommerce. I just copied archive-product.php page to my theme directory and wrapped all code inside my all content and it worked like a charm 🙂
    Hope, that will solve problems of any new comer like me …

  2. Your problem is not located on woocommerce templates like suggest your answer, but in the woocommerce.php file located in your active theme folder.

    There you will need add in the id="container" html tag all occurrences, a class="container". For example:

    <div id="container">
    

    Will need to be replace by:

    <div id="container" class="container">
    

    Or by:

    <div class="container">
    

    This will solve your issue.

    Another solution without editing this woocommerce.php file is adding for example a jQuery script like this:

    jQuery(document).ready(function($) {
        $( "body.woocommerce-page #container" ).addClass( "container" );
    });