function gen_gallery_item($id, $group_id)
    {
        $img_attr = wp_get_attachment_image_src($id, 'full');
        ?>
	<a href="<?php 
        echo $img_attr[0];
        ?>
" class="fancy-image" data-group="<?php 
        echo $group_id;
        ?>
">
		<div class="img-box">
		<?php 
        echo gen_responsive_image_block($id, array(array('width' => 290), array('width' => 290 * 2, 'media' => '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
        ?>
		<i class="icon icon-plus overlay-icon"></i>
		</div>
	</a>
<?php 
    }
 filter-item <?php 
        echo $post_categories_id_string;
        ?>
">
				
				<div class="img-box">
					<div class="overlay-wrap">
						<a href="<?php 
        the_permalink();
        ?>
">
							<?php 
        if (get_post_thumbnail_id()) {
            ?>
								<?php 
            echo gen_responsive_image_block(get_post_thumbnail_id(), array(array('width' => $width, 'height' => $height, 'crop' => true), array('width' => $width * 2, 'height' => $height * 2, 'crop' => true, 'media' => '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
            ?>
							<?php 
        } else {
            ?>
								<div class="thumb-dummy"></div>
							<?php 
        }
        ?>
						</a>
						<div class="overlay">
							<div class="overlay-content">
								<strong><?php 
        the_title();
        ?>
</strong>
?>

		<?php 
$counter = 0;
foreach ($stack['features'] as $feature) {
    ?>

				<div class="span4">
					<?php 
    if ($feature['link'] != '') {
        echo '<a href="' . $feature['link'] . '">';
    }
    ?>
					<?php 
    if ($feature['image']) {
        echo gen_responsive_image_block($feature['image'], array(array('width' => 300), array('width' => 300 * 2, 'media' => '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
    }
    ?>
					<?php 
    if ($feature['link'] != '') {
        echo '</a>';
    }
    ?>
					<div class="feature-title">
						<?php 
    if ($feature['link'] != '') {
        echo '<a href="' . $feature['link'] . '">';
    }
    ?>
							<?php 
    echo $feature['stack_title'];
function theme_shortcode_image($atts, $content = null, $code)
{
    extract(shortcode_atts(array('source' => false, 'width' => 'full', 'lightbox' => false, 'link' => false, 'target' => '_self'), $atts));
    switch ($width) {
        case 'full':
            $width = 940;
            break;
        case 'full_sidebar':
            $width = 600;
            break;
        case 'one_half':
            $width = 460;
            break;
        case 'one_third':
            $width = 300;
            break;
        case 'two_third':
            $width = 620;
            break;
        case 'one_fourth':
            $width = 290;
            break;
        case 'three_fourth':
            $width = 700;
            break;
    }
    $ret = gen_responsive_image_block($source, array(array('width' => $width), array('width' => $width * 2, 'media' => '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
    if ($lightbox == 'youtube' || $lightbox == 'vimeo') {
        $ret .= '<i class="icon icon-play-circle overlay-icon overlay-icon-stay"></i>';
    } else {
        if ($lightbox == 'image') {
            $ret .= '<i class="icon icon-plus overlay-icon"></i>';
        }
    }
    if ($link) {
        $fancy = $lightbox ? 'fancy-' . $lightbox : '';
        $ret = '<a href="' . $link . '" class="' . $fancy . '" target="' . $target . '" data-group="group">' . $ret . '</a>';
    }
    return '<div class="img-box">' . $ret . '</div>';
}
		<?php 
    global $post;
    foreach ($posts as $post) {
        setup_postdata($post);
        $thumb_id = get_post_meta($post->ID, '_info_image', true);
        $thumb_url = wp_get_attachment_image_src($thumb_id, 'portfolio-thumb');
        $short_desc = get_post_meta($post->ID, '_info_short_desc_text', true);
        $meta = get_post_meta($post->ID, '_info_meta', true);
        $socials = get_post_meta($post->ID, '_info_social_list', true);
        ?>
			<div class="span3 masonry-item">
				
				<div class="img-box">
					<div class="overlay-wrap">
						<?php 
        echo gen_responsive_image_block($thumb_id, array(array('width' => 290), array('width' => 290 * 2, 'media' => '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
        ?>
					</div>
					<div class="img-info">
						<div class="person-info-head">
							<div class="person-name"><?php 
        the_title();
        ?>
</div>
							<div class="person-meta"><?php 
        echo $meta;
        ?>
</div>
						</div>

						<?php 
" data-height="<?php 
    echo $img_attr[2];
    ?>
" data-pagination="true" data-autoplay="true" data-interval="<?php 
    echo theme_options('portfolio', 'img_slide_pause') * 1000;
    ?>
" data-speed="<?php 
    echo theme_options('portfolio', 'img_slide_animate_speed') * 1000;
    ?>
">
		<?php 
    foreach ($images_list as $image_id) {
        ?>
			<div class="slide">
			<?php 
        echo gen_responsive_image_block($image_id, array(array('width' => 290, 'media' => '(max-width: 767px)'), array('width' => 290 * 2, 'media' => '(max-width: 767px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'), array('width' => 466, 'media' => '(min-width: 768px)'), array('width' => 466 * 2, 'media' => '(min-width: 768px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'), array('width' => 600, 'media' => '(min-width: 980px)'), array('width' => 600 * 2, 'media' => '(min-width: 980px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
        ?>
			</div>
		<?php 
    }
    ?>
		</div><!-- .slides -->
		<?php 
}
?>
	</div>
	</div>

	<div class="span4">
		<?php 
the_content();
    ?>
			</div>
		</div>

	<?php 
} else {
    // Image on the Left
    ?>

		<div class="<?php 
    echo $img_col;
    ?>
">
			<div class="img-box">
				<?php 
    echo gen_responsive_image_block($stack['image'], array(array('width' => $img_width), array('width' => $img_width * 2, 'media' => '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
    ?>
			</div>
		</div>
		<div class="<?php 
    echo $text_col;
    ?>
">
			<?php 
    if ($stack['stack_title'] != '') {
        ?>
<div class="stack-title"><?php 
        echo $stack['stack_title'];
        ?>
<span class="spot"></span></div><?php 
    }
					</div>
				<?php 
        }
        ?>

				<?php 
        if (!$full_width) {
            ?>
					<?php 
            echo gen_responsive_image_block($slide['image'], array(array('width' => 450, 'height' => $slide_height * 450 / 940, 'crop' => true, 'media' => '(max-width: 767px)'), array('width' => 450 * 2, 'height' => $slide_height * 2 * 450 / 940, 'crop' => true, 'media' => '(max-width: 767px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'), array('width' => 724, 'height' => $slide_height * 724 / 940 + $slide_parallax_distance, 'crop' => true, 'media' => '(min-width: 768px)'), array('width' => 724 * 2, 'height' => ($slide_height * 724 / 940 + $slide_parallax_distance) * 2, 'crop' => true, 'media' => '(min-width: 768px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'), array('width' => 940, 'height' => $slide_height + $slide_parallax_distance, 'crop' => true, 'media' => '(min-width: 980px)'), array('width' => 940 * 2, 'height' => ($slide_height + $slide_parallax_distance) * 2, 'crop' => true, 'media' => '(min-width: 980px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
            ?>
				<?php 
        } else {
            ?>
					<?php 
            echo gen_responsive_image_block($slide['image'], array(array('width' => 450, 'height' => $slide_height * 450 / 1200, 'crop' => true, 'media' => '(max-width: 767px)'), array('width' => 450 * 2, 'height' => $slide_height * 2 * 450 / 1200, 'crop' => true, 'media' => '(max-width: 767px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'), array('width' => 980, 'height' => $slide_height * 980 / 1200 + $slide_parallax_distance, 'crop' => true, 'media' => '(min-width: 768px)'), array('width' => 980 * 2, 'height' => ($slide_height * 980 / 1200 + $slide_parallax_distance) * 2, 'crop' => true, 'media' => '(min-width: 768px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)'), array('width' => 1200, 'height' => $slide_height + $slide_parallax_distance, 'crop' => true, 'media' => '(min-width: 980px)'), array('width' => 1200 * 2, 'height' => ($slide_height + $slide_parallax_distance) * 2, 'crop' => true, 'media' => '(min-width: 980px) and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)')));
            ?>
				<?php 
        }
        ?>


			</div>

		<?php 
    }
    ?>

	</div>
</div>
</div><!-- .stack-slider -->