Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: My Image Archives
- */
- get_header(); ?>
- <div id="primary" class="site-content">
- <div id="content" role="main">
- <?php
- $query_images_args = array(
- 'post_type' => 'attachment',
- 'post_status' => 'inherit',
- 'posts_per_page' => -1,
- );
- $query_images = new WP_Query( $query_images_args );
- //$images = array();
- $ids='';
- foreach ( $query_images->posts as $image) {
- $ids.=','.$image->ID;
- }
- echo do_shortcode('[gallery ids="'.$ids.'"]');
- ?>
- </div><!-- #content -->
- </div><!-- #primary -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement