View difference between Paste ID: w0yJ3sZP and qXZAzjCZ
SHOW: | | - or go back to the newest paste.
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('posts_per_page=8&post_type=page&post_parent='.$parent);
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-
		   <?php if ( has_post_thumbnail() ) { ?>
20+
          
21-
		   
21+
22
			   
23-
			   <div class="detailthumb-1"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thin-detail'); ?></a></div>        
23+
			  <?php $width = (ceil($wp_query->current_post/2)%2) ? 'thin-detail' : 'wide-detail'; echo $width; ?>
24
25-
		   <?php } ?>
25+
			<div class="detailthumb-1"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail($width); ?></a></div>        
26-
		   
26+
27-
		   <?php if ( has_post_thumbnail() ) { ?>
27+
28-
		   
28+
29
30-
			   <div class="detailthumb-2"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('wide-detail'); ?></a></div>        
30+
31
32-
		   <?php } ?>
32+
33-
		   
33+
34-
		   
34+
35-
		   
35+