Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Created June 27, 2013 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/5877866 to your computer and use it in GitHub Desktop.
Save clifgriffin/5877866 to your computer and use it in GitHub Desktop.
global $post;
$images = get_children('post_type=attachment&post_mime_type=image&post_parent=' . $post->ID . '&orderby=menu_order&order=ASC');
foreach($images as $img) {
$image_attributes = wp_get_attachment_image_src($img->ID, "products");
$src = $image_attributes[0];
if(!empty($src)) {
echo "<img src='$src' />";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment