2015-05-10 63 views
1

我在集成貓頭鷹滑塊和WordPress主題時遇到了問題。該滑塊應該可以得到最新4篇文章的精選圖片,標題和一個小說明。問題是輸出owl-slider顯示出來的檢查,但作爲一個白格,沒有別的,爲什麼我的貓頭鷹滑塊不顯示?

問題的截圖:http://i.imgur.com/jKKt8Qx.png

循環的代碼:

<div class="SlideShow"> 
    <div id="owl-slider" class="owl-carousel owl-theme"> 
     <?php 
     $the_query = new WP_Query('posts_per_page=4'); 
     while ($the_query->have_posts()) : $the_query->the_post(); 
     ?> 
     <div class="item"> 
      <?php the_post_thumbnail('full'); ?> 
      <div class="caption"> 
       <a href="<?php the_permalink(); ?>">التفاصيل</a><!--More Link--> 
       <div class="innercapt"> 
        <h1><?php the_title(); ?></h1><!--Title--> 
        <p><?php echo excerpt(9);?></p><!--Description--> 
       </div> 
      </div> 
     </div> 
     <?php endwhile; 
     // Reset Post Data 
     wp_reset_postdata(); ?> 
    </div> 
</div> 

的函數被調用這個代碼在頁腳:

<script> 
    ;(function($){ 
     $("#owl-slider").owlCarousel({ 
      autoPlay: true, 
      navigation : true, // Show next and prev buttons 
      slideSpeed : 300, 
      pagination : false, 
      singleItem : true 
     }); 
    })(jQuery); 
</script> 
+0

你需要調用貓頭鷹旋轉木馬功能的DOM元素被創建後,並確定他們沒有隱藏。你甚至還打電話給Carousel功能? – brance

+0

@brance更新了問題,請檢查它。 – 99teko

+0

你能發佈一個鏈接到你的頁面,因爲我看不到任何代碼問題。似乎旋轉木馬無法正確計算滑塊的寬度和高度,但我不能100%確定是否存在問題。 – brance

回答

0

嘗試添加CSS方向LTR的類貓頭鷹傳送帶 因爲傳送帶在身體方向RTL錯誤

0

嘗試包在這樣的document.ready JS代碼,也許它會工作,我找不到任何可能導致錯誤的內容。

;(function($){ 
$(document).ready(function() { 
    $("#owl-slider").owlCarousel({ 
     autoPlay: true, 
     navigation : true, // Show next and prev buttons 
     slideSpeed : 300, 
     pagination : false, 
     singleItem : true 
    }); 
}); 
})(jQuery); 
+0

也沒有工作。 – 99teko

+0

你可以在貓頭鷹更新之前刪除腳本並粘貼HTML輸出嗎? – brance

+0

對不起,你是什麼意思的「更紅」? – 99teko