Viewing 1 replies (of 1 total)
  • Thread Starter adehner

    (@adehner)

    Okay, I figured it out…

    In the loop:

    $attachments = get_children(array('post_parent' => $post->ID,
                            		'post_status' => 'inherit',
                            		'post_type' => 'attachment',
                            		'post_mime_type' => 'image',
                            		'order' => 'ASC',
                            		'orderby' => 'menu_order ID'));
    
    				foreach($attachments as $att_id => $attachment) {
        					$full_img_url = wp_get_attachment_url($attachment->ID);  ?>
    					<a href='<?php echo $full_img_url; ?>' rel='lightbox[<?php the_ID(); ?>]' class='hidden' title='<?php echo get_the_title(); echo "<br />".$attachment->post_excerpt; ?>'></a>
    				<?php }

    And where the featured images display:

    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );?>
    <a class="post-thumbnail" href="<?php echo $image[0]; ?>" rel="lightbox[<?php the_ID(); ?>]" title="<?php echo get_the_title();  echo '<br />'.$caption;?>" aria-hidden="true">
    		      <?php
    			the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) );
    		      ?>
    	              </a>

Viewing 1 replies (of 1 total)
  • The topic ‘Link to lightbox gallery from category archive’ is closed to new replies.