not getting all the images added to the post getting images from the gallery

I am getting all the images of the product gallery. how can get the images that the user have added to the post from the product gallery

<p> <?php
$images =& get_children( array (
‘post_parent’ => $id,
‘post_type’ => ‘attachment’,
‘post_mime_type’ => ‘image’
));

if ( empty($images) ) {
// no attachments here
} else {
foreach ( $images as $attachment_id => $attachment ) {
echo wp_get_attachment_image( $attachment_id, ‘thumbnail’ );
}
}
?>

</p>

Read more here:: not getting all the images added to the post getting images from the gallery

Leave a Reply

Your email address will not be published. Required fields are marked *