Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //// GETS OUR IMAGES
- $query_images_args = array(
- 'post_type' => 'attachment',
- 'post_mime_type' =>'image',
- 'post_status' => 'inherit',
- 'posts_per_page' => -1,
- 'post_parent' => get_the_ID(),
- 'orderby' => 'menu_order',
- 'order' => 'ASC',
- );
- $query_images = new WP_Query( $query_images_args );
- $images = array();
- $featured = getFeaturedImage(get_the_ID());
- $images[] = $featured;
- foreach ( $query_images->posts as $image) {
- //// MAKES SURE WE DONT INCLUDE OUR FEATURED IMAGE
- $this_image = wp_get_attachment_url( $image->ID );
- if($this_image != $featured[0]) {
- $images[]= array(
- $this_image,
- 'caption' => $image->post_excerpt
- );
- }
- }
- /// IF WE HAVE MORE THAN JUST ONE IMAGE
- if(count($query_images->posts) >= 2) :
- ?>
- <div class="sidebar-item not-in-responsive">
- <script type="text/javascript">
- jQuery(document).ready(function() {
- jQuery('#property-gallery-thumbs').propertyGallery();
- });
- </script>
- <ul id="property-gallery-thumbs">
- <?php
- //// LOOPS EACH IMAGE
- $i = 1;
- foreach($images as $image) :
- ?>
- <li class="thumb<?php if($i==1) { echo ' current'; } ?><?php if($i%3 == 0) { echo ' last'; } ?>">
- <span class="hidden full"><?php echo $image[0]; ?></span>
- <span class="hidden main"><?php echo ddTimthumb($image[0], 680, 450); ?></span>
- <span class="thumb"><img src="<?php echo ddTimthumb($image[0], 76, 76); ?>" alt="<?php the_title() ?>" title="<?php the_title(); ?>" /></span>
- </li>
- <?php $i++; endforeach; ?>
- </ul>
- <!-- /#property-gallery-thumbs/ -->
- </div>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement