Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Subpages Thumbnail Page
- */
- ?>
- <?php get_header(); ?>
- <div id="main-container-subpages">
- <div class="main">
- <span style="display:none;"><?php the_ID(); ?></span>
- <?php $parent = $post->ID; ?>
- <?php
- query_posts( array(
- 'posts_per_page' => 8,
- 'post_type' => 'page',
- 'post_parent' => $parent,
- 'meta_key' => '_thumbnail_id'
- ));
- while (have_posts()) : the_post(); ?>
- <?php $width = (ceil($wp_query->current_post/2)%2) ? 'thin-detail' : 'wide-detail'; ?>
- <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $width );
- $url = $thumb['0']; ?>
- <div class="detailthumb-<?php echo (ceil($wp_query->current_post)%4)+1; ?>"
- style="background-image: url('<?php echo $url; ?>');">
- <a class="subpage-link" href="<?php the_permalink(); ?>">
- <span class="detail-title"><?php the_title(); ?></span>
- </a>
- </div>
- <?php endwhile; ?>
- </div> <!--Main-->
- <div class="clear"> </div>
- </div> <!--Main Container (Subpages)-->
- <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment