I have an image gallery of sorts its displayed on the page using the following template code...
<?php
$featured = get_post_meta($post->ID,'_thumbnail_id',true);
$attachments = get_children( 'post_type=attachment&orderby=menu_order&exclude='.$featured.'&post_mime_type=image&post_parent='.$post->ID ); ?>
<ul id="fac">
<?php foreach ($attachments as $attachment) {
$img = wp_get_attachment_image_src($attachment->ID);
$img_large = wp_get_attachment_image_src($attachment->ID, 'full'); ?>
<li><a rel="example" href="<?php the_permalink() ?>"><img class="fac-img" src="<?php echo $img[0] ?>" width="<?php echo $img[1] ?>" height="<?php echo $img[2] ?>" /></a></li>
<?php } ?>
</ul>
The image linking to the main single page of the post.
Now is there any way that one there is only 1 image attached it doesn't show the link?
So you attach one image to the post it shows it on its own.
If however, you upload more than one image it adds the link around that image a long with link text 'click to view more images' or whatever.
Clicking that takes you to a new single.php page where all the images are there running a gallery js script which is already done.
Possible or not?
Thank you for any help.