videogramme
Member
Posted 5 months ago #
Hi,
how exactly do i get the first "thumbnail" attach to a post ?
I have multiple images attache on my post.
But i need to just take the first image in thumbnail size.
If have got this code that display all attached images in thumbnail size :
$attachments = new Attachments( 'my_attachments' );
if( $attachments->exist() ) :
while( $attachments->get() ) :
$attachments->image( 'thumbnail' ));
endwhile;
endif;
thanks in advance.
http://wordpress.org/extend/plugins/attachments/
Hi, check out the usage docs to see that you need to echo your call to image():
$attachments = new Attachments( 'my_attachments' );
if( $attachments->exist() ) :
while( $attachments->get() ) :
echo $attachments->image( 'thumbnail' );
endwhile;
endif;
If you enjoy Attachments please take a second to rate and review!
videogramme
Member
Posted 5 months ago #
Hi,
Thanks for the fast respons.
Sorry it was a copy error.
But i still don't know how to display only the first attached image.
Help will be much appreciat.
Thx in advance
[Don't bump]
videogramme
Member
Posted 5 months ago #
it's not resolved pls give me some help
$attachments = new Attachments( 'my_attachments' );
if( $attachments->exist() ) :
$attachments->get();
echo $attachments->image( 'thumbnail' );
endif;
videogramme
Member
Posted 5 months ago #
Thank you verry much. It work like a charme. Your awesome ; )