Skip to content

Instantly share code, notes, and snippets.

@alisonmf
Created February 4, 2011 02:37
Show Gist options
  • Save alisonmf/810652 to your computer and use it in GitHub Desktop.
Save alisonmf/810652 to your computer and use it in GitHub Desktop.
work template for the main work page
<?php
// Page Template Name: Work
?>
<?php get_header(); ?>
<div id="content">
<h1 class="noLine">Work</h1>
<?php $args=array(
'post_type' => 'work',
);
$my_query = null;
$my_query = new WP_Query($args);
if ( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php
$postimageurl = get_post_meta($post->ID, 'thumbnail', true);
$postclientname = get_post_meta($post->ID, 'client_name', true);
?>
<a href="<?php the_permalink(); ?>">
<img class="border" src="<?php bloginfo('url'); ?>/wp-content/work/thumbnails/<?php echo $postimageurl; ?>" alt="<?php the_title(); ?>" />
</a>
<div class="thumbnailInfo">
<h3>The Title</h3>
<h4><?php echo $postclientname; ?></h4>
</div>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
</div><!-- /content -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment