1
我將此代碼包含到我的圖像附件模板(image.php)文件中以顯示當前帖子的縮略圖庫。wordpress禁用圖片在圖庫中查看
function show_all_gallery_thumbs()
{
global $post;
$post = get_post($post);
/* image code */
$images =& get_children('post_type=attachment&post_mime_type=image&output=ARRAY_N&orderby=menu_order&order=ASC&post_parent='.$post->post_parent);
if($images)
{
$thumblist = '<ul class="thumbnails">';
foreach($images as $imageID => $imagePost)
{
unset($the_b_img);
$the_b_img = wp_get_attachment_image($imageID, array(64,64));
$thumblist .= '<li class="span1"><a href="'.get_attachment_link($imageID).'" class="thumbnail">'.$the_b_img.'</a></li>';
}
$thumblist .= '</ul>';
}
return $thumblist;
}
我該如何檢測正在查看哪個圖像並禁用/突出顯示圖庫中的圖像?
作品完美!謝謝您的幫助 :) – user2636556