Advertisement
Guest User

Untitled

a guest
Aug 17th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php query_posts( array( 'category__and' => array(1), 'orderby' => 'title', 'order' => 'DESC' ) );
  2.  
  3. while ( have_posts() ) : the_post(); ?>
  4.  
  5. <?php
  6. $args = array( 'post_type' => 'attachment', 'orderby' => 'menu_order', 'posts_per_page' => 6, 'order' => 'DESC', 'post_mime_type' => 'image', 'post_status' => null, 'post_parent' => $post->ID );
  7. $images = get_posts($args);
  8. if ($images) {
  9.  
  10. foreach ( $images as $image ) { ?>
  11. <a href="<?php echo wp_get_attachment_url( $image->ID , 'thumbnail' ); ?>" rel="lightbox"><div class="home-thumbs"><?php echo wp_get_attachment_image( $image->ID , 'thumbnail' ); ?></div><!--end home-thumbs--></a>
  12.  
  13. <?php }
  14. } ?>
  15.  
  16. <?php endwhile;
  17.  
  18. // Reset Query
  19. wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement