Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . $postID );
- $attachment_id = $images[0]->ID;
- $images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . $postID );
- $attachment_id = $images[0]->ID;
- $attachments = get_children( array(
- 'post_parent' => get_the_ID(),
- 'post_type' => 'attachment',
- 'numberposts' => 1, // show all -1
- 'post_status' => 'inherit',
- 'post_mime_type' => 'image',
- 'order' => 'ASC',
- 'orderby' => 'menu_order ASC'
- ) );
- foreach ( $attachments as $attachment_id => $attachment ) {
- echo wp_get_attachment_image( $attachment_id );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement