I've put together this loop based on the Codex page for the get_children function. This works within a post's loop to spit out the URL of each attached image, and it spits them out perfectly.
ie:
http://domain.com/uploads/image01.jpg
http://domain.com/uploads/image02.jpg
http://domain.com/uploads/image03.jpg
<?php // find images attached to this post / page.
$images =& get_children( 'post_parent='. $post->ID .'&orderby=menu_order&order=ASC&post_type=attachment&post_mime_type=image&numbersposts=-1' );
foreach ( (array) $images as $attachment_id => $attachment ) { ?>
<?php echo wp_get_attachment_url( $attachment_id ); ?>
<?php } ?>
Where it gets weird on me, is when I try to use that URL within an image tag. I'm making use of timthumb, which is why I want the URL and not the normal image link
When I change the code to what I have below, it will spit out all the images, but only 2 will include the src for the images. The rest will just have the original=[imageurl] included, but no src=[imageurl]. This is very odd to me.
<?php // find images attached to this post / page.
$images =& get_children( 'post_parent='. $post->ID .'&orderby=menu_order&order=ASC&post_type=attachment&post_mime_type=image&numbersposts=-1' );
foreach ( (array) $images as $attachment_id => $attachment ) { ?>
<img src="<?php bloginfo('template_url'); ?>/thumb.php?src=<?php echo wp_get_attachment_url( $attachment_id ); ?>&h=145&w=235&zc=1" alt="<?php the_title(); ?>" width="235" height="145" border="0" />
<?php } ?>
Any attachment loop experts out there have any idea as to why it wouldn't include the source for the rest of the images?