dongrao9454 2014-03-11 12:04 采纳率: 100%
浏览 151

Wordpress <?php body_class(); 问题

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.

  • 写回答

3条回答 默认 最新

  • donk68254 2014-03-11 12:15
    关注

    Can you try to replace this:

    <?php body_class(); ?>
    

    by this:

    <body <?php body_class(); ?>>
    

    ?

    评论

报告相同问题?