first image only

This topic contains 1 reply and 2 voices, and was last updated by Sekander Badsha 9 years, 7 months ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
September 9, 2014 at 5:30 pm 26538
Sekander Badsha Hi, I got an image loader, that I display like you indicated in my php : $images = get_post_meta( $post->ID, 'photos_flat' ); if ( $images){ foreach ( $images as $attachment_id ) { $thumb = wp_get_attachment_image( $attachment_id, 'thumbnail' ); $full_size = wp_get_attachment_url( $attachment_id ); printf( '', $full_size, $thumb ); } } I want to display only the first image from the post, is there an easy way ? I'm a bit lost with it ... Thanks,
September 11, 2014 at 10:29 am 26635
Sekander Badsha Sekander Badsha

Hello Olivier,
We do not provide any customization support. This article can be helpful for you: http://css-tricks.com/snippets/wordpress/get-the-first-image-from-a-post/

You may google for “get first image wordpress” to get more solutions.

Viewing 1 Posts - 1 through 1 (of 1 total)