ID', $link = '1', $img_class = 'attachment-image', $wrapper = 'div', $wrapper_class = 'attachment-image-wrapper') { global $post; $images = get_children( array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); if ($images) { $num_of_images = count($images); if ($offset > 0) : $start = $offset--; else : $start = 0; endif; if ($limit > 0) : $stop = $limit+$start; else : $stop = $num_of_images; endif; $i = 0; foreach ($images as $attachment_id => $image) { if ($start <= $i and $i < $stop) { $img_title = $image->post_title; // title. $img_description = $image->post_content; // description. $img_caption = $image->post_excerpt; // caption. //$img_page = get_permalink($image->ID); // The link to the attachment page. $img_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true); if ($img_alt == '') { $img_alt = $img_title; } if ($big == 'large') { $big_array = image_downsize( $image->ID, $big ); $img_url = $big_array[0]; // large. } else { $img_url = wp_get_attachment_url($image->ID); // url of the full size image. } // FIXED to account for non-existant thumb sizes. $preview_array = image_downsize( $image->ID, $size ); if ($preview_array[3] != 'true') { $preview_array = image_downsize( $image->ID, 'full' ); $img_preview = $preview_array[0]; // thumbnail or medium image to use for preview. $img_width = $preview_array[1]; $img_height = $preview_array[2]; } else { $img_preview = $preview_array[0]; // thumbnail or medium image to use for preview. $img_width = $preview_array[1]; $img_height = $preview_array[2]; } // End FIXED to account for non-existant thumb sizes. /////////////////////////////////////////////////////////// // This is where you'd create your custom image/link/whatever tag using the variables above. // This is an example of a basic image tag using this method. ?> < class="">
large bug collections | Claire Moynihan