2016-07-23 61 views
0

我沒有找到足夠的資源知道關於貓頭鷹旋轉木馬 WordPress插件。如果你知道,請解釋。如何使用貓頭鷹輪播WordPress插件?

+2

告訴我們你嘗試過什麼,因爲我記住他們有一個很好的文檔,所以我認爲你需要的只是閱讀他們的文檔 –

回答

0

我會得到圖像URL,並簡單地循環通過While循環(或循環)內的後實例 - 實質上是獲取發佈資產的基本循環。

我正在使用工具集插件並使用所述循環調用需要的元素。

<ul class="attributes"> 
      <?php 
       $values = array( 
        // 'author_name' => 'author', 
        'post_type' => 'attribute', 
        'orderby' => 'id' 
       ); 

       $query = new WP_Query($values); 

       if ($query->have_posts()) : 
        while ($query->have_posts()) : $query->the_post(); 
       $name = get_post_meta($post->ID, 'wpcf-value-name', true); 
      ?> 

      <li> 
       <div class="values-content"> 
        <div class="title"> 
         <p><?php echo $name; ?></p> 
        </div> 
        <div class="text"> 
         <p><?php echo get_post_meta($post->ID, 'wpcf-value-text', true); ?></p> 
        </div> 
        <div class="icon"> 
         <?php $icons = get_post_meta($post->ID, 'wpcf-value-icon', true); ?> 
         <img src="<?php echo $icons; ?>" alt="<?php echo $name; ?>"> 
        </div> 
       </div> 
      </li> 

      <?php endwhile; else: ?> 
       <p>Sorry, there are no posts to display</p> 
      <?php endif; ?> 
     </ul> 

如果您需要任何幫助,請告訴我。如果您決定堅持使用插件,這很好,但我不會用它:)我打電話了jQuery的「屬性」類名熟悉:

// carousel for about page values 
jQuery(".attributes").owlCarousel({ 
    autoWidth: true, 
    items: 1 
}); 
相關問題