2012-10-18 157 views
0

每当我通过wordpress或新的woocommerce页面添加新页面时,由于安装woocommerce插件都会将侧边栏推到内容下的页面底部。侧边栏出现在wordpress内容下

我不知道为什么会发生这种情况。请查看所附照片

enter image description here

这是代码的样子在我的主题侧边栏的CSS

/* Sidebar 
---------------------------------------- */ 
#sidebar { 
    float: Left; 
} 

    .widget { 
     background: url(images/box-tail.gif) repeat-x 50% 0%; 
     position: relative; 
     margin: 0 0 30px 0; 
     border: 1px solid #f0f0f0; 
     border-top: none; 
     border-radius: 4px; 
     -moz-border-radius: 4px; 
     -webkit-border-radius: 4px; 
    } 

     ul.children { 
      margin: 0 0 0 20px; 
     } 

    .widget-indent { 
     padding: 0 20px 19px 20px; 
    } 

.primary_content_wrap .widget { 
    padding: 0 19px 19px 19px; 
} 

.primary_content_wrap h3 { 
    padding: 0 0 21px 0; 
} 

.primary_content_wrap .widget #searchform { 
    width: 100%; 
} 

    .primary_content_wrap .widget #searchform input[type="text"] { 
     width: 123px; 
    } 

这是我的sidebar.php

<aside id="sidebar" class="grid_6 omega"> 
    <?php if (! dynamic_sidebar('Sidebar')) : ?> 

     <div id="sidebar-search" class="widget"> 
      <h3>Search</h3> 
      <?php get_search_form(); ?> <!-- outputs the default Wordpress search form--> 
     </div> 

     <div id="sidebar-nav" class="widget menu"> 
      <h3>Navigation</h3> 
      <?php wp_nav_menu(array('menu' => 'Sidebar Menu')); ?> <!-- editable within the Wordpress backend --> 
     </div> 

     <div id="sidebar-archives" class="widget"> 
      <h3>Archives</h3> 
      <ul> 
       <?php wp_get_archives('type=monthly'); ?> 
      </ul> 
     </div> 

     <div id="sidebar-meta" class="widget"> 
      <h3>Meta</h3> 
      <ul> 
       <?php wp_register(); ?> 
       <li><?php wp_loginout(); ?></li> 
       <?php wp_meta(); ?> 
      </ul> 
     </div> 

    <?php endif; ?> 
</aside><!--sidebar--> 

然后将此是我如何在每个页面中调用侧边栏的方式

<?php get_sidebar(); ?> 

任何帮助将不胜感激。

UPDATE 外观>小部件

enter image description here

+0

检查您的外观 - >小工具,看看有什么。 – SMacFadyen

+0

我用外观>小部件的图像更新了我的问题,它在框中说这会出现在页面的右侧。 – HurkNburkS

+0

你能提供一个安装的链接吗?这对确定问题会有很大的帮助。 CSS级联。在页面的其他地方可能会出现问题。您发布的代码不足以确定问题或让您知道如何解决问题。 – evandentremont

回答

1

您是否检查过该页面当前正在使用哪个模板?

的“ 所有页”名单上

点击快速编辑从模板下拉菜单中选择你的页面不同的模板?

+0

这篇文章启发我检查页面..我无法找到我的商店页面,但我能够重新创建..使用woocommerce简码..通过这样做,它完全添加了我的侧边栏! 非常感谢帮助。 – HurkNburkS

0

确保添加到侧边栏的宽度,你的主要内容宽度小于你的页面主体的宽度。这可以解释为什么,即使使用“float:left”属性,您的侧边栏也会在页面的底部。

而且,为什么不包括在你的PHP条件下整个侧边栏代码:

<?php if (! dynamic_sidebar('Sidebar')) : ?> 
<aside id="sidebar" class="grid_6 omega"> 
     <div id="sidebar-search" class="widget"> 
      <h3>Search</h3> 
      <?php get_search_form(); ?> <!-- outputs the default Wordpress search form--> 
     </div> 

     <div id="sidebar-nav" class="widget menu"> 
      <h3>Navigation</h3> 
      <?php wp_nav_menu(array('menu' => 'Sidebar Menu')); ?> <!-- editable within the Wordpress backend --> 
     </div> 

     <div id="sidebar-archives" class="widget"> 
      <h3>Archives</h3> 
      <ul> 
       <?php wp_get_archives('type=monthly'); ?> 
      </ul> 
     </div> 

     <div id="sidebar-meta" class="widget"> 
      <h3>Meta</h3> 
      <ul> 
       <?php wp_register(); ?> 
       <li><?php wp_loginout(); ?></li> 
       <?php wp_meta(); ?> 
      </ul> 
     </div> 
</aside><!--sidebar--> 
<?php endif; ?> 
+0

好的谢谢你的信息..上面的代码使一切都疯狂了..但它确实设法让菜单右边有它的一面仍然无法使用,但因为它做了什么,其余的现场。 – HurkNburkS

+0

我想我会尝试找到woocommerce购物车的宽度,并将其做得更小,以便菜单符合..只需要弄清楚...很多代码可能很难找到。 – HurkNburkS

+0

您也可以重写css属性。你可以使用Firebug或类似的东西找到它,并在你自己的css中覆盖块的css属性。 – VeZoul

0

你可以提供一个链接到您的安装?这可能是您提供的代码之外的问题,并且可能通过查看实时站点更容易解决。

0

您是否尝试在侧边栏和左侧内容中定义宽度值?让你的左边的内容也浮动(如果没有)。例如

#sidebar{ 
    float:right; //much better to use float right if the sidebar will be placed at the right side of the page 
    width:100px; //define a smaller temporary value of the width for testing purposes 
} 

#left_content{ 
    float:left; 
    width:300px;  
} 

您可能会尝试调整CSS并在浏览器中使用萤火虫检查html元素。 检查http://getfirebug.com/

0

我认为这很可能是非常简单的事情。您使用的网格使得制作列非常容易。你的页面模板会像这样:

<?php get_header(); ?> 

<div class="container_12"> 

<div class="grid_6"> 
<--- main content here ---> 
</div> 

<?php get_sidebar(); ?> 

</div> 


<?php get_footer(); ?> 
0

当主要内容和侧边栏已分配给它们的尺寸不彼此相邻或过多的保证金或填充适合,侧边栏会自动移动到下方的屏幕。这可能会导致问题