Check if post has more than one image attached
<?php $attachments = get_children( array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $post->ID )); if(count($attachments) > 1) { ?> <!-- Do something like show a slider --> <?php } else { ?> <!-- Display a single image --> <?php } ?>
Instructions:
A pretty simple if statement, wrote this up for my theme framework. In my case I used it to check if the post has more than one image display a slider, else display the single image.