Wordpress侧边栏在引导程序中出错

时间:2013-11-13 23:17:44

标签: wordpress twitter-bootstrap sidebar

基本上,我将页面拆分为2列,并尝试将侧边栏代码插入右侧(span4)。但出于某种原因,它一直在span8下显示

页面代码     

<div class="row pull-right"><div class="span12" id="hdimg"></div></div>

<div class="row pull-right" id="pgg">

<div class="span8" id="pagecn">
    <?php the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
         <div class="entry-content">
             <div class="ttl">
        <?php if ( is_singular() ) {echo '<h1 class="entry-title">';} else {echo '<h2 class="entry-title">';} ?><a title="<?php printf( __('Read %s', 'blankslate'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a><?php if ( is_singular() ) {echo '</h1>';} else {echo '</h2>';} ?>
             </div>
             <div id="cn">
<?php the_content(); ?>
             </div>
         </div>
    </div>
</div>

 <div class="span4">

<?php if ( is_active_sidebar('primary-widget-area') ) : ?>
 <div id="primary" class="widget-area">
<ul class="sid">
<?php dynamic_sidebar('primary-widget-area'); ?>
</ul>
 </div>
<?php endif; ?>
 </div>
</div>
</div>

<?php get_footer(); ?>

css for it

#hdimg {
width: 948px;
height:185px;
background-image: url(images/banner.jpg);
}


#pgg {
width:948px;
margin-top:4px;
background-color: white;
padding-top: 10px;
padding-bottom: 20px;
}

#cn {margin-top: 15px;}

链接即可看到直播 http://soloveich.com/project3/

1 个答案:

答案 0 :(得分:0)

#pgg {
width:948px;
margin-top:4px;
background-color: white;
padding-top: 10px;
padding-bottom: 20px;
}

删除宽度

#pgg {
margin-top:4px;
background-color: white;
padding-top: 10px;
padding-bottom: 20px;
}

我看到你试图做的但你错误地使用了它 - 以不同的方式修复背景

<div class="" id="hdimg"></div>

这是针对您的标题 - 移除网格

将#hdimg width更改为

  

hdimg {width:960px!important; }