侧栏出现在wordpress的内容下方

每次我通过wordpress和/或由于安装woocommerce插件而拥有的新woocommerce页面添加新页面时, 都会将侧边栏推到内容下方页面的底部。
我不知道为什么会这样。请检查所附照片

侧栏出现在wordpress的内容下方

文章图片
这是代码在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外观> 小配件
侧栏出现在wordpress的内容下方

文章图片
#1 你是否检查了页面当前使用的模板?
在” 所有页面” 列表中,
单击快速编辑, 然后从” 模板” 下拉列表中为页面选择其他模板?
#2 确保添加到侧边栏宽度的主要内容宽度小于页面正文的宽度。这可以解释为什么即使使用” 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; ?>

#3 你可以提供安装链接吗?问题可能出在你提供的代码之外, 并且通过查看实时站点可能更容易解决。
#4 【侧栏出现在wordpress的内容下方】你是否尝试过在边栏和左侧内容中定义宽度值?使你的剩余内容也浮动(如果没有)。例如
#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; }

你可以尝试在浏览器中使用Firebug调整CSS并检查html元素。检查此http://getfirebug.com/
#5 我认为这很可能很简单。你使用的网格使创建列非常容易。你的页面模板如下所示:
< ?php get_header(); ?> < div class="container_12"> < div class="grid_6"> < --- main content here ---> < /div> < ?php get_sidebar(); ?> < /div> < ?php get_footer(); ?>

#6 如果为主要内容和侧边栏分配的大小彼此不匹配, 或者页边距或边距过大, 则侧边栏将自动移至屏幕底部。这可能会引起问题

    推荐阅读