I have the following code in my functions.php:
function get_images($size = 'thumbnail') {
global $post;
return get_children( array('post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );
}
And in my single.php
<?php $photos = get_images('full'); ?>
<?php $x = 0; ?>
<?php foreach($photos as $photo): ?>
<?php if($x < 1): ?>
<img src="<?=wp_get_attachment_url($photo->ID)?>" alt="fullImg" />
<?php endif; ?>
<?php $x++;
?>
<?php endforeach; ?>
I want to show just ONE image there, but it shows me also the post-thumb image, which I don't want, is there an option to exclude that?