| 1 |
<?php |
| 2 |
/** |
| 3 |
* Single Property Thumbnails |
| 4 |
* |
| 5 |
* @author PropertyHive |
| 6 |
* @package PropertyHive/Templates |
| 7 |
* @version 1.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 |
|
| 12 |
global $post, $propertyhive, $property; |
| 13 |
|
| 14 |
if ( isset($images) && is_array($images) && !empty($images) ) { |
| 15 |
|
| 16 |
?> |
| 17 |
<div class="thumbnails flexslider" id="carousel"> |
| 18 |
|
| 19 |
<ul class="slides"> |
| 20 |
<?php |
| 21 |
|
| 22 |
$loop = 0; |
| 23 |
$columns = apply_filters( 'propertyhive_property_thumbnails_columns', 3 ); |
| 24 |
|
| 25 |
foreach ($images as $image) |
| 26 |
{ |
| 27 |
|
| 28 |
$classes = array(); |
| 29 |
|
| 30 |
if ( $loop == 0 || $loop % $columns == 0 ) |
| 31 |
$classes[] = 'first'; |
| 32 |
|
| 33 |
if ( ( $loop + 1 ) % $columns == 0 ) |
| 34 |
$classes[] = 'last'; |
| 35 |
|
| 36 |
$image_class = esc_attr( implode( ' ', $classes ) ); |
| 37 |
|
| 38 |
echo '<li>' . apply_filters( 'propertyhive_single_property_image_thumbnail_html', $image['image'], ( isset($image['attachment_id']) ? $image['attachment_id'] : '' ) , $post->ID, $image_class ) . '</li>'; |
| 39 |
|
| 40 |
++$loop; |
| 41 |
} |
| 42 |
|
| 43 |
?> |
| 44 |
</ul> |
| 45 |
|
| 46 |
</div> |
| 47 |
<?php |
| 48 |
} |