Skip to content

Instantly share code, notes, and snippets.

@jimmyhillis
Created January 27, 2013 02:45
Show Gist options
  • Save jimmyhillis/4645969 to your computer and use it in GitHub Desktop.
Save jimmyhillis/4645969 to your computer and use it in GitHub Desktop.
Simple stub to use within a Wordpress template for building a full size image page, which will be seen whenever you view the permalink for any images in a Wordpress blog. Add this to your theme with the filename `image.php` to use this for all images. Might also consider using `attachment.php` or `single-attachment.php` depending on your situation.
<article class="article">
<?php $attachment_info = getimagesize($post->guid); ;?>
<div class="content">
<img src="<?php echo $post->guid; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" <?php echo $attachment_info[3]; ?> />
</div>
<a href="<?php echo get_permalink($post->post_parent); ?>" title="<?php echo get_the_title($post->post_parent); ?>">Back to <?php echo get_the_title($post->post_parent); ?></a>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment