1

このコードを画像添付テンプレート (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;
}

どの画像が表示されているかを検出し、ギャラリーのサムネイルで画像を無効/強調表示するにはどうすればよいですか?

4

1 に答える 1