Created
December 18, 2012 00:54
-
-
Save turboclaw/4323944 to your computer and use it in GitHub Desktop.
Single post with an image gallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<div class="leftside"> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<h3 class="title"><?php the_title(); ?></h3> | |
<h4 class="date"> ... </h4> | |
<div class="description"> | |
<?php the_content(); ?> | |
</div> | |
<ul class="gallery_detail"> | |
<?php | |
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); | |
if ( $images ) : | |
$total_images = count( $images ); | |
$image = array_shift( $images ); | |
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); | |
?> | |
<li><a class="lightbox" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a></li> | |
<?php endif; ?> | |
</ul> | |
<?php endwhile; ?> | |
</div><!-- /.leftside --> | |
<?php get_sidebar(); /* .rightside stuff */ ?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment