ScratchPad


Trey Ratcliff Gallery

[php_everywhere]

Souce Code

<div class="gallery-album">
	<div class="gallery-item">
			<?php 
			$args = array(
				'post_type' => 'attachment',
				'post_mime_type' => 'image',
				'orderby' => 'post_date',
				'order' => 'asc',
				'posts_per_page' => '30',
				'post_status'    => 'inherit',
				'category_name' => 'Trey Ratcliff'
			 );
			$loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post();
			$image = wp_get_attachment_image_src( get_the_ID(), 'full' ); // Full sized image
			$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' ); // Thumbnail size 
      ?>

				<div class="cell"><a href="<?php echo $image[0]; ?>"><img src="<?php echo $thumb[0]; ?>" class="responsive-image"></a></div>

			<?php endwhile; ?>
	</div>
</div>