The key on that one is you have to setup the image links the way Simple Light Box advises:
The key is the Image Link section in the aforementioned documentation. You need to make sure that this option is set to either Attachment Page or Media File before you insert the image into your post. This will wrap the inserted thumbnail image with a link that loads the full-size version of the image when it is clicked. Thanks to SLB, the full-size image will be displayed in a lightbox rather than loading an entirely new page.
That means your images can’t just be output as images, they have to be output the way the Plugin author advises, wrapping the thumbnail with a link that loads the full size version of the image when it is clicked. You can either check for that syntax and output it in your echo above, or use one of the WordPress image output functions.
This response about the best way to Display Pod based Images in your Template file explains the relationship between outputting images that way:
http://stackoverflow.com/questions/21918954/the-best-way-to-display-pod-based-images-in-your-template-file
Hi,
Thanks for your clear response!
Now since the image field is in a custom post type, the “attachment display settings” don’t appear in the media uploader. The other way, as you mentioned, is add it in php, would you know how to place the following into links? I’m pretty new to php and unsure of how to do it. I’m using the image ouput code from the stackoverflow.com link you provided. (p.s. I have 2 sets of images, each have multiple images).
<?php
if ( get_post_meta( get_the_ID(), ‘large_image’, false ) ){
$image_array = get_post_meta( get_the_ID(), ‘large_image’, false );
}
if ( $image_array ) {
echo ‘
‘;
foreach ( $image_array as $image ) {
$class = “post-attachment mime-” . sanitize_title( $image->post_mime_type );
$thumbimg = wp_get_attachment_image( $image[‘ID’], ‘original’);
echo ‘<li class=”‘ . $class . ‘ data-design-thumbnail”>’ . $thumbimg . ”;
}
echo ‘
‘;
}
?>
<?php
if ( get_post_meta( get_the_ID(), ‘small_image’, false ) ){
$image_array = get_post_meta( get_the_ID(), ‘small_image’, false );
}
if ( $image_array ) {
echo ‘
‘;
foreach ( $image_array as $image ) {
$class = “post-attachment mime-” . sanitize_title( $image->post_mime_type );
$thumbimg = wp_get_attachment_image( $image[‘ID’], ‘original’);
echo ‘<li class=”‘ . $class . ‘ data-design-thumbnail”>’ . $thumbimg . ”;
}
echo ‘
‘;
}
?>
Thanks again,
Emma