first image only
-
Hi,
I got an image loader, that I display like below in my php :<?php $images = get_post_meta( $post->ID, 'photos_flat' ); if ( $images ) { printf( '<div id="slider">' ); foreach ( $images as $attachment_id ) { $thumb = wp_get_attachment_image( $attachment_id, 'thumbnail' ); $full_size = wp_get_attachment_url( $attachment_id ); printf( '<div class="img"><a href="%s">%s</a></div>', $full_size, $thumb ); } printf( '</div>' ); } ?>
I want to display only the first image from the post, is there an easy way ? I’ve tried a bunch of things, but can’t find a valid solution …
I’m a bit lost with it …Thanks,
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘first image only’ is closed to new replies.