Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template name: All Images
- */
- // Get the header
- get_header();
- // Image attachment query arguments
- $images_query_args = array(
- 'post_type' => 'attachment',
- 'post_status' => 'inherit',
- 'post_mime_type' => 'image'
- );
- // Query image attachments
- $images_query = new WP_Query( $images_query_args );
- // Image attachment query loop
- if ( $images_query->have_posts() ) : while ( $images_query->have_posts() ) : $images_query->the_post();
- // Output the attachment image
- wp_get_attachment_image( get_the_ID(), 'thumbnail' );
- endwhile; endif;
- // Be kind; rewind
- wp_reset_postdata();
- // Get the footer
- get_footer();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement