I built my theme into WordPress and all was good, then I wanted to add woocommerce to the theme to add a shop. The woocommerce was not showing its styles. So I did some research and found the reason was my <body>
tag should of been <body <?php body_class(); ?>>
.
This was not in the guide I followed to convert the html.
So I added the tag in and the woocommerce styling appears fine. BUT the whole site has pushed left.
Here is the site - www.theinurse.com could anyone let me know why? I have tried a few things in css but nothing has resolved it. If i edit the following css the site moves
html, body {
height: 100%;
margin: 0pt;
}
If I edit margin it moves, but if I set margin-left: auto; margin-right:auto;
etc etc it does nothing. But if I do margin-left:100px;
it moves the site right 100px.
Baffling me! If I remove the body_class tag it sits perfectly. Please help me.
Can you try to replace this:
<?php body_class(); ?>
by this:
<body <?php body_class(); ?>>
?
If you have declared
add_theme_support( 'woocommerce' );
the system expect you to have the WooCommerce styles integrated in your theme stylesheet. This is why it don't call for the default stylesheet.
You forgot the re-add the body class Frame
. Your CSS code uses the Frame class to center the content.
<body <?php body_class('Frame'); ?>>
The Codex
entry for body_class() states there is a parameter $class.
class (string or array) (optional) One or more classes to add to the class attribute, separated by a single space.
Use this parameter to make WordPress include the extra body classes you've added yourself.