0
你好我想instegrate滑塊到我的wordpress theme.This是我到目前爲止有:?檢索循環縮略圖URL
<?php
$slider_query = new WP_Query(array(
'posts_per_page'=>'5'
));
if($slider_query->have_posts()):
while($slider_query->have_posts()):
$slider_query->the_post();
if(function_exists('has_post_thumbnail') && has_post_thumbnail()){
the_post_thumbnail();
}
endwhile;
endif;
>
雖然這工作,並檢索圖像我需要能夠回報url,因爲我必須爲標題設置不同的標題屬性。
任何人都知道的方式來檢索縮略圖的網址?
編輯:我也tryed使用
$url = wp_get_attachment_image_src(the_post_thumbnail());
但SOM原因查詢返回10個鏈接IMG的,我把它設置爲5 only.Wierd的事情是,即使圖像必須獲取URL沒有來源。
這將返回一個數組,其['[0]'th索引是源;) – Ben 2015-02-19 20:30:32