我将此代码包含在我的图像附件模板 (image.php) 文件中,以显示当前帖子的缩略图库。
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;
}
我将如何检测正在查看的图像并禁用/突出显示我的画廊缩略图中的图像?