2013-09-22 169 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