Skip to content

Instantly share code, notes, and snippets.

@jaspertandy
Created October 19, 2011 12:08
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 jaspertandy/1298113 to your computer and use it in GitHub Desktop.
Save jaspertandy/1298113 to your computer and use it in GitHub Desktop.
in functions.php
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 150, 150 ); // default Post Thumbnail dimensions
add_image_size('homepage-image', 327, 218, true);
add_image_size('single-image', 675, 450, true);
}
then in the single.php i have
<?php
$images =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $post->ID );
foreach ($images as $image) : ?>
<li><?php echo wp_get_attachment_image($image->ID, 'single-image'); ?></li>
<?php endforeach ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment