2014-09-10 36 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

相关问题