Advertisement
rdsaunders

WordPress Landing Template - Using Child Page Featured Image

Apr 15th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.13 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Projects
  4. */
  5. get_header(); ?>
  6.  
  7. <div id="primary">
  8.    
  9. <div id="content" role="main">
  10.     <header class="entry-header">
  11.     <h1 class="entry-title"><?php the_title(); ?></h1> 
  12.     </header>      
  13.    
  14.         <div class="entry-content">
  15.  
  16.         <?php the_content(); ?>
  17.    
  18.         <?php
  19.         $args = array(
  20.         'post_parent' => $post->ID,
  21.         'post_type' => 'page',
  22.         'post_status' => 'publish',
  23.         'numberposts' => -1
  24.         );
  25.            
  26.         $postslist = get_posts($args);
  27.         foreach ($postslist as $post) :
  28.         setup_postdata($post);
  29.         ?>
  30.                        
  31.         <div class="project">
  32.        
  33.         <a href="<?php the_permalink(); ?>"><?php if( has_post_thumbnail() ) the_post_thumbnail('Project'); ?></a>
  34.        
  35.         <div class="project-meta">
  36.             <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  37.             <p class="time"><?php the_time('F, Y') ?></p>
  38.         </div><!-- project-meta -->
  39.                
  40.         <div class="project-summary">
  41.             <?php the_excerpt(); ?>
  42.         </div><!-- project-summary -->
  43.        
  44.         </div><!-- project -->
  45.                        
  46.         <?php endforeach; ?>
  47.            
  48.         </div><!-- entry-content -->
  49.            
  50.     </div><!-- #content -->
  51.    
  52.     </div><!-- #primary -->
  53.    
  54. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement