我正在爲'垃圾'中的某些帖子生成查詢。我可以檢索精選圖片網址,但我正在尋找一種方法來獲取服務器上的精選圖片文件位置。WordPress精選圖片的實際文件位置?
# generate the query
foreach ($query as $post) {
$thumbID = get_post_thumbnail_id($post->ID);
$thumbObj = get_post($thumbID);
$source_url = $thumbObj->guid;
# how do I get the string "/path/to/wordpress/media/library/thumbnail.jpg" ?
}
我無法找到任何返回實際特色圖像文件位置的WordPress函數。
你的意思是這樣的:http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src wp_get_attachment_image_src – 2014-12-05 00:42:09