For my jigoshop theme I'm able to retrieve the images attached to my product post. However it pulls all images from both the featured image and my metabox images. What I'm trying to do is make it so that it excludes the featured image, but it's not working. It also seems to be including other post featured images as well for some reason.
I tried this suggestion with no luck.
Here's what I have so far:
global $_product, $post; $thumb_id = get_post_thumbnail_id($post->ID); $args = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID, 'orderby' => 'menu_order', 'exclude' => $thumb_id, 'order' => 'asc' ); $attachments = get_posts($args); if ($attachments) : $loop = 0; foreach ( $attachments as $attachment ) : if ($thumb_id==$attachment->ID) continue; $loop++; $_post = get_post( $attachment->ID ); $url = wp_get_attachment_url($_post->ID); $post_title = esc_attr($_post->post_title); $image = wp_get_attachment_image_src($attachment->ID, 'full'); $image = $image; $image_path = thumbGen($image,500,0,"crop=1&halign=center&valign=center&return=1"); $image_all = get_bloginfo('url').$image_path; $my_image = array_values(getimagesize($image_all)); list($width, $height, $type, $attr) = $my_image; if ( ! $image || $url == get_post_meta($post->ID, 'file_path', true) ) continue; echo '<span><img src="'.$image.'" alt="'.get_the_title().'" title="'.get_the_title().'" width="'.$width.'" height="'.$height.'"/></span>'; endforeach; endif;