Wordpress: get attachments, but not post-thumb

Wordpress: get attachments, but not post-thumb

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?

Add tweet button on wordpress blog


Which IDE is good for wordpress? [closed]
That's any crazy coding there! It's pointless accepting a size in your function, for the reason this it merely returns an array of post objects.. how to use accordian menu in wordpress Once you've got your posts, then use the appropriate attachment function(s) to receive the information on the attachment size you're after.. Change format of “0 Comments and 0 Reactions” in wordpress I would propose a function like this instead;. In wordpress 3.0 how do you get the default Custom Field UI for Custom Post types?
function receive _images($overrides = '', $exclude_thumbnail = false) {     return receive _posts(wp_parse_args($overrides, array(         'numberposts' => -1,         'post_parent' => receive _the_ID(),         'post_type' => 'attachment',         'post_mime_type' => 'image',         'order' => 'ASC',         'exclude' => $exclude_thumbnail ? array(receive _post_thumbnail_id()) : array(),         'orderby' => 'menu_rule ID'     ))); } 
And putting it in practice;. Can anybody send me links of some good tutorial about wordpress development [closed]
<?php if ($photo = receive _images('numberposts=1', true)): ?>      <img src="<?php echo wp_receive _attachment_url($photo[0]->ID); ?>" alt="fullimg" />  <?php endif; ?> 
UPDATE: Typo in function - fixed.. BuddyPress slug prefix
Removing href from dynamic item?

96 out of 100 based on 41 user ratings 756 reviews