Skip to content

Instantly share code, notes, and snippets.

@rosshanney
Created April 15, 2012 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosshanney/2391990 to your computer and use it in GitHub Desktop.
Save rosshanney/2391990 to your computer and use it in GitHub Desktop.
<?php
/*
Template Name: Projects
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php
$args = array(
'post_parent' => $post->ID,
'post_type' => 'page',
'post_status' => 'publish',
'numberposts' => -1
);
$postslist = get_posts($args);
?>
<?php foreach ( $postslist as $post ) : ?>
<?php setup_postdata( $post ); ?>
<div class="project">
<a href="<?php the_permalink(); ?>"><?php if( has_post_thumbnail() ) the_post_thumbnail('Project'); ?></a>
<div class="project-meta">
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p class="time"><?php the_time('F, Y') ?></p>
</div><!-- project-meta -->
<div class="project-summary">
<?php the_excerpt(); ?>
</div><!-- project-summary -->
</div><!-- project -->
<?php endforeach; ?>
</div><!-- entry-content -->
<?php endwhile; endif; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment