如何为下面的单个附件图像创建单个贴子页面并链接到它?
<?php get_header(); ?>
<div id="body">
<?php if (have_posts()) : ?>
<div class="page_title">
<h2><?php single_cat_title(); ?></h2>
</div>
<div class="photos">
<ul class="lb-album">
<?php while (have_posts()) : the_post(); ?>
<?php $images = get_post_meta($post->ID, \'za_plupload\'); ?>
<?php
$images = implode( \',\' , $images );
$images = $wpdb->get_col( "
SELECT ID FROM {$wpdb->posts}
WHERE post_type = \'attachment\'
AND ID in ({$images})
ORDER BY menu_order ASC
" );
?>
<?php $i = 0; ?>
<?php foreach ($images as $att) {
$src = wp_get_attachment_image_src($att, \'full\');
$src = $src[0];
$image_path = thumbGen($src,330,0,"crop=1&halign=center&valign=center&return=1");
$image_all = get_bloginfo(\'url\').$image_path;
$my_image = array_values(getimagesize($image_all));
list($width, $height, $type, $attr) = $my_image;
?>
<li class="box image_holder" style="height:<?php echo $height; ?>px!important;"><a href="<?php echo $image_path2; ?>" style="height:<?php echo $height; ?>px!important;"><img src="<?php echo $image_path; ?>" alt="" width="330" height="<?php echo $height; ?>" class="image" /></a></li>
<?php $i++; ?>
<?php } ?>
<?php endwhile; ?>
<div class="clear"></div>
</ul>
</div>
<?php endif;?>
<?php wp_reset_query(); ?>
<div class="clear"></div>
</div>
<div class="clear"></div>
<?php get_footer(); ?>