2013-09-22 168 views
1

我有一个侧栏,我想要在我的内容左侧位置。我尝试了所有我能想到的东西,但无法让侧栏显示在页面的左侧。WordPress的侧边栏定位

<div class="container"> 
     <header> 

     </header> 
    <?php if (is_active_sidebar('primary')) {?> 
<div class='cats'> 
    <?php dynamic_sidebar('primary'); } ?> 
    </div> 
     <div class='content_wrapper'> 
     <?php if (have_posts()) : ?> 
     <?php /* Start the Loop */ ?> 
     <?php while (have_posts()) : the_post(); ?> 

     <div class="posts"> 
      <article> 
       <div class="wrapper"> 
       <h2 class='headline'><a href="<?php the_permalink() ?>"></h2> 

       <div class='thumbs'> 

       <p><?php echo content('120'); ?></p> 
      </article> 
      //..... 
        // some code 
       </div> 
      </div> 
     ... some more code 

回答

1
Please Put this after header, so you can have sidebar at left 

<?php get_sidebar(); ?> 

和用于动态侧杆使用此CSS

.container 
{ 
    margin:auto!important; 
} 
.cats 
{ 
    float:left; 
    width:30%; 
} 
.content_wrapper 
{ 
    float:right; 
    width:68%; 
} 
+0

我使用的是动态侧边栏所以我使用的 线展示侧边栏,难道你不认为我需要一些CSS来改变侧边栏位置吗? – Farzan

+0

请给我你的网站链接,然后我会帮你 –

+0

当然,这是在http://www.pharzan.com/bitlog – Farzan