<?php
global $post;
$query = new WP_Query(array(
            'post_type' => 'gall',
            'post__in' => array($post_id)
        ));
$gallery_width = get_option(THEMEMAKERS_THEME_PREFIX . 'gallery_width');

$slider_height = get_option(THEMEMAKERS_THEME_PREFIX . 'gallery_height');
if (!$slider_height) {
    $slider_height = 415;
}

if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();
        ?>
        <div class="pics" style="overflow: hidden">
            <?php if (has_post_thumbnail()) { ?>
                <?php
            }
            //get images quantity
            $images = get_post_meta($post->ID, 'thememakers_gallery', true);

            if (is_array($images) AND !empty($images)) {
                foreach ($images as $img_src) {
                    if ($img_src != '') {
                        $img_src = ThemeMakersHelper::resize_image($img_src, $gallery_width, true, $slider_height);
                        ?>
                        <img src="<?php echo $img_src; ?>" width="<?php echo $gallery_width; ?>" height="<?php echo $slider_height ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
                        <?php
                    }
                }
            }
            ?>
        </div><!--/ pics-->
        <div class="descr-wrapper">
            <div class="any-text">
                <h4><?php the_title(); ?></h4>
            </div><!--/ .any-text-->

            <div class="buttons">
                <a href="#" title="<?php _e('Previous', THEMEMAKERS_THEME_FOLDER_NAME); ?>" class="prev"><?php _e('Previous', THEMEMAKERS_THEME_FOLDER_NAME); ?></a>
                <a href="#" title="<?php _e('Next', THEMEMAKERS_THEME_FOLDER_NAME); ?>" class="next"><?php _e('Next', THEMEMAKERS_THEME_FOLDER_NAME); ?></a>
            </div><!--/ buttons-->
        </div><!--/ descr-wrapper-->
        <?php
    endwhile;
endif;

