Advertisement
Guest User

Untitled

a guest
Feb 10th, 2012
1,672
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php $args = array(
  2.     'post_type'      => 'attachment',
  3.     'post_parent'    => $post->ID,
  4.     'post_status'    => 'inherit',
  5.     'post_mime_type' => 'image',
  6. );?>
  7.  
  8.  
  9.  
  10. <ul>
  11. <?php $posts = query_posts( $query_string . 'order=asc' ); ?>
  12.  
  13. <?php if (have_posts()): while (have_posts()): the_post(); ?>
  14.  
  15. <?php $attachments = new WP_Query( $args );
  16. $attachments->get_posts();
  17.  
  18. $output = '';
  19. foreach( $attachments->posts as $attachment ) {
  20.     $image_src = wp_get_attachment_image_src( $attachment->ID, 'large');
  21.     $output = '<a href="'. $image_src[0] .'" rel="lightbox[post-1]" class="hidden"></a>';
  22. }
  23. ?>
  24.  
  25. <?php
  26. $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
  27. ?>
  28. <a href="<?php $image_src[0]; ?>" rel="lightbox[post-1]">
  29. <?php the_post_thumbnail( 'thumbnail-size'); ?>
  30. </a>
  31.  
  32.    
  33.    
  34.  
  35. <?php endwhile; endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement