2014-09-10 34 views
0

我已經創建了自定義郵政類型「滑塊」。我遇到的問題是它不顯示滑塊中的原始圖片大小。 這裏是我的代碼WordPress的 - 如何在郵政中顯示原始特色圖像大小

<?php 

       $options = array(
      'post_type' => "slideshow", 

    ); 
      $my_query = new WP_Query($options); 


      while ($my_query->have_posts()) : $my_query->the_post(); 

      if (has_post_thumbnail()) { 
    $image = wp_get_attachment_image_src(get_post_thumbnail_id(the_ID())); 
}?> 
      <div data-thumb="<?php echo $image[0];?>" 
      data-src="<?php echo $image[0];?>"> 


      </div> 

      <?php endwhile; ?> 
+0

我編輯了我的答案,參數'full'被支持,這就是原始圖像。 – 2014-09-10 18:12:44

回答

0

按照docs,你可以在參數large傳遞給wp_get_attachment_image_src功能:

wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); 

這樣做的問題是,檢查source code這個功能似乎是一個限制圖像的大小。

+0

非常感謝 – hellosheikh 2014-09-11 14:20:10

相關問題