WordPress Gallery with ID’s Shortcode not Working

depend on your code if you use it as gallery shortcode i think this will work :

<div class="gallery-content">
<?php 
if( has_shortcode( $post->post_content, 'gallery' ) ) :  
    if ($ids != '') {
        $images = explode(',', $ids);
    } else {
        $images = get_children(array('post_parent' => get_the_ID(),'post_type' => 'attachment','post_mime_type' => 'image', 'orderby' => 'menu_order_ID'))
    }
    if ($images) :
        $image_list="<ul class="galleryslider">"; 
        foreach( $images as $image ) :
            if ($ids != '') {
                $image = get_post($image);
            } 
            $attachmenturl=wp_get_attachment_url($image->ID);
            $attachmentimage=wp_get_attachment_image($image->ID, 'full' );
            $img_title = $image->post_title;
            $img_desc = $image->post_excerpt;
            $image_list .= '<li><a href="'.$attachmenturl.'" '. $lightbox .' data-title="'.$img_desc.'" title="'.$img_title.'"><div class="gallery-image-title">'.$img_title.'</div>'.$attachmentimage.'</a><div class="gallery-image-desc">'.$img_desc.'</div></li>';
        endforeach; 
        $image_list .= '</ul>';  
        echo $image_list;               
    endif;
endif;
?>