Advertisement
Guest User

Untitled

a guest
Jun 12th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template name: All Images
  4. */
  5.  
  6. // Get the header
  7. get_header();
  8.  
  9. // Image attachment query arguments
  10. $images_query_args = array(
  11. 'post_type' => 'attachment',
  12. 'post_status' => 'inherit',
  13. 'post_mime_type' => 'image'
  14. );
  15. // Query image attachments
  16. $images_query = new WP_Query( $images_query_args );
  17.  
  18. // Image attachment query loop
  19. if ( $images_query->have_posts() ) : while ( $images_query->have_posts() ) : $images_query->the_post();
  20.  
  21. // Output the attachment image
  22. wp_get_attachment_image( get_the_ID(), 'thumbnail' );
  23.  
  24. endwhile; endif;
  25.  
  26. // Be kind; rewind
  27. wp_reset_postdata();
  28.  
  29. // Get the footer
  30. get_footer();
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement