Advertisement
alchymyth

alternating thumb loop

Mar 30th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. Template Name: Subpages Thumbnail Page
  4. */
  5. ?>
  6.  
  7. <?php get_header(); ?>
  8.  
  9. <div id="main-container-subpages">
  10.    <div id="bottomclear">&nbsp;</div>
  11.    
  12.    <div class="subpages">
  13.         <span style="display:none;"><?php the_ID(); ?></span>
  14.         <?php $parent = $post->ID; ?>
  15.        
  16.         <?php
  17.         query_posts( array('posts_per_page' => 8, 'post_type' => 'page', 'post_parent' => $parent,'meta_key' => '_thumbnail_id' ));
  18.        
  19.         while (have_posts()) : the_post(); ?>
  20.          
  21.                <?php $image_thumb = get_post_meta($post->ID, 'image-thumb', true); ?>
  22.                
  23.               <?php $width = (ceil($wp_query->current_post/2)%2) ? 'thin-detail' : 'wide-detail'; echo $width; ?>
  24.  
  25.             <div class="detailthumb-1"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail($width); ?></a></div>        
  26.                
  27.        
  28.        <?php endwhile; ?>
  29.  
  30.    </div>
  31.  
  32.    <div id="bottomclear">&nbsp;</div>
  33. </div>
  34.  
  35. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement