Advertisement
salvatorifabio

loop-index-camera

Jun 4th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <div class="camera_wrap">
  2. <?php
  3.  
  4. $argslide = array('post_type' => 'slide');
  5. $loop = new WP_Query($argslide);
  6. if ( $loop->have_posts() ) while ( $loop->have_posts() ) : $loop->the_post(); ?>
  7.  
  8.  
  9. <?php
  10.  
  11. $args = array( 'order' => 'ASC',
  12. 'orderby' => 'menu_order',
  13. 'post_type' => 'attachment',
  14. 'post_parent' => $post->ID,
  15. 'post_mime_type' => 'image',
  16. 'post_status' => null,
  17. 'numberposts' => -1,
  18. //'exclude' => $thumb_id
  19. );
  20.  
  21. $attachments = get_posts($args);
  22. foreach ($attachments as $attachment){
  23. $image_big = wp_get_attachment_image_src( $attachment->ID, 'big' );
  24. $image_small = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' ); ?>
  25. <div data-thumb="<?php echo $image_small[0] ?>" data-src="<?php echo $image_big[0] ?>"></div>
  26. <?php } ?>
  27. <?php endwhile; ?>
  28. </div>
  29. <script type="text/javascript" charset="utf-8">
  30. jQuery('.camera_wrap').camera({
  31. thumbnails: true
  32. }
  33. });
  34. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement