Skip to content

Instantly share code, notes, and snippets.

@RevConcept
Created September 16, 2013 01:50
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 RevConcept/6575877 to your computer and use it in GitHub Desktop.
Save RevConcept/6575877 to your computer and use it in GitHub Desktop.
Modifications to include a lightbox effect with the post attachment automatic slide output: http://revelationconcept.com/wordpress-display-all-post-attachment-images-in-a-slider/
// Add this after line 18 in the example:
$thumb_array = image_downsize( $image->ID, 'your-custom-image-size' );
$thumb_url = $thumb_array[0];
// Now, you will need to modify the output to include your thumbnail image, a link to the full image and your lighbox classes. So lines 20-28 should look something like this:
echo '<li>';
echo '<a class="your-lightbox-class" href="';
echo $img_url;
echo '">';
echo '<img src="';
echo $thumb_url;
echo '" alt="';
echo $img_alt;
echo '" title="';
echo $img_title;
echo '" />';
echo '</a>';
echo '</li><!--end slide-->';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment