Advertisement
Guest User

Photo Gallery

a guest
Mar 28th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php get_header(); ?>  
  2.  
  3. <div class="<?php the_title(); ?>-page">  
  4.  
  5. <!-- BEGIN CODE FOR PRODUCT AREA -->
  6.    <?php $gallery = get_terms('albums');
  7. foreach($gallery as $album) {
  8.     $album = $album->name; ?>
  9.         <div class="entrytext">
  10.         <div id="photos">
  11.         <!-- post begin -->
  12.         <?php $loop = new WP_Query(array('post_type' => 'photos', 'posts_per_page' => - 1, 'albums' => $album)); ?>
  13.         <?php while ($loop->have_posts()):
  14.         $loop->the_post(); ?>
  15.             <?php
  16.         $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array(5600, 1000), false, '');
  17. ?>
  18.             <div class="photo" style="background: url(<?php echo $src[0]; ?> ) !important;"></div>
  19.              
  20.         <?php
  21.     endwhile; ?>
  22.         <br clear="all" />
  23.         <!-- post end -->
  24.         <br clear="all" />
  25.           <?php wp_reset_query(); ?>
  26.           <?php rewind_posts(); ?>
  27.         </div>
  28.         </div>
  29.    <?php
  30. } // End foreach $gallery
  31.  ?>
  32.         </div> <!-- "title"-page -->  
  33.  
  34. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement