/** * Generated gallery for a property * @param int $property_id * @param int $gallery_limit */ function inspiry_property_gallery($property_id = 0, $gallery_limit = 3) { if (!$property_id) { $property_id = get_the_ID(); } $gallery_images = inspiry_get_post_meta('REAL_HOMES_property_images', array('type' => 'image_advanced', 'size' => 'inspiry-grid-thumbnail'), $property_id); if (!empty($gallery_images) && 0 < count($gallery_images)) { ?> <div class="gallery-slider-two flexslider"> <ul class="slides"> <?php $gallery_image_count = 1; foreach ($gallery_images as $gallery_image) { $caption = !empty($gallery_image['caption']) ? $gallery_image['caption'] : $gallery_image['alt']; echo '<li>'; echo '<a class="swipebox" data-rel="gallery-' . $property_id . '" href="' . esc_url($gallery_image['full_url']) . '" title="' . $caption . '" >'; echo '<img class="img-responsive" src="' . esc_url($gallery_image['url']) . '" alt="' . $gallery_image['title'] . '" />'; echo '</a>'; echo '</li>'; if ($gallery_image_count == $gallery_limit) { break; } $gallery_image_count++; } ?> </ul> </div> <?php } else { inspiry_thumbnail(); } }
if (!empty($embed_code)) { ?> <div class="post-thumbnail-container"> <div class="embed-responsive embed-responsive-4by3"> <?php echo stripslashes(htmlspecialchars_decode($embed_code)); ?> </div> </div> <?php } else { $thumbnail_needed = true; } } else { if ($format == 'gallery') { $gallery_images = inspiry_get_post_meta('REAL_HOMES_gallery', array('type' => 'image_advanced', 'size' => 'inspiry-grid-thumbnail'), get_the_ID()); if (!empty($gallery_images) && 0 < count($gallery_images)) { ?> <div class="post-thumbnail-container"> <div class="gallery-slider-two flexslider"> <ul class="slides"> <?php $gallery_image_count = 1; foreach ($gallery_images as $gallery_image) { // caption $caption = !empty($gallery_image['caption']) ? $gallery_image['caption'] : $gallery_image['alt']; echo '<li>'; echo '<a class="swipebox" data-rel="gallery-' . get_the_ID() . '" href="' . $gallery_image['full_url'] . '" title="' . $caption . '" >'; echo '<img src="' . $gallery_image['url'] . '" alt="' . $gallery_image['title'] . '" />'; echo '</a>'; echo '</li>';
<?php global $post; $gallery_images = inspiry_get_post_meta('REAL_HOMES_property_images', array('type' => 'image_advanced', 'size' => 'post-thumbnail'), $post->ID); if (!empty($gallery_images)) { ?> <div class="single-property-slider"> <ul id="image-gallery" class="list-unstyled"> <?php foreach ($gallery_images as $gallery_image) { // caption $caption = !empty($gallery_image['caption']) ? $gallery_image['caption'] : $gallery_image['alt']; ?> <li data-thumb="<?php echo esc_url($gallery_image['url']); ?> "> <a class="swipebox" href="<?php echo esc_url($gallery_image['full_url']); ?> " title="<?php echo esc_attr($caption); ?> "> <img class="img-responsive" src="<?php echo esc_url($gallery_image['url']); ?> " alt="<?php echo esc_attr($gallery_image['title']); ?> "/>
/** * Get list of gallery images * * @since 1.0.0 * @param string $size */ function inspiry_standard_gallery($size = 'post-thumbnail') { global $post; $gallery_images = inspiry_get_post_meta('REAL_HOMES_gallery', array('type' => 'image_advanced', 'size' => $size), $post->ID); if (!empty($gallery_images)) { echo '<div class="blog-gallery-slider gallery-slider flexslider">'; echo '<ul class="slides list-unstyled">'; foreach ($gallery_images as $gallery_image) { $caption = !empty($gallery_image['caption']) ? $gallery_image['caption'] : $gallery_image['alt']; echo '<li><a class="swipebox" data-rel="gallery-' . $post->ID . '" href="' . esc_url($gallery_image['full_url']) . '" title="' . $caption . '" >'; echo '<img src="' . esc_url($gallery_image['url']) . '" alt="' . $gallery_image['title'] . '" />'; echo '</a></li>'; } echo '</ul>'; echo '</div>'; } else { if (has_post_thumbnail($post->ID)) { inspiry_standard_thumbnail($size); } } }