WP – Image.php mostrar galeria en post de imagen

WP – Image.php mostrar galeria en post de imagen

$post_parent = get_post($post->ID, ARRAY_A);
$parent = $post_parent[‘post_parent’];

$attachments = get_children(“post_parent=$parent&post_type=attachment&post_mime_type=image&orderby=menu_order ASC, ID ASC”);
foreach($attachments as $id => $attachment) :
echo wp_get_attachment_link($id, ‘thumbnail’, true);
endforeach;
?>