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(); ?>>
    

    ?

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分