• Resolved Oscar

    (@chasix)


    My primary focus with WordPress is my photography. I created a custom taxonomy for my images.
    I was able to tag each photo and also create a custom tag page for the custom taxonomy that showcases the thumbnail of each photo based on the tag.
    My question is on the custom taxonomy page where the photos are outputted. I would like the images to open in lightbox and not to the attachment page for that particular image.

    Below is some of the code that is used in my custom taxonomy php page.

    This code outputs the thumbnails based on the custom tag. The thumbnails link to the attachment page. I would like to open the images in a lightbox. Adding rel=”lightbox” opens the attachment page in a lightbox.

    <?php while (have_posts()): the_post(); ?>
    <a href='<?php the_permalink() ?>' title='<?php the_title(); ?>'><?php echo wp_get_attachment_image( '','thumbnail' ); ?></a>
    <?php endwhile; ?>

    Thanks for any help or helpful links in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Oscar

    (@chasix)

    Got it!

    <a href="<?php echo wp_get_attachment_url($image->ID); ?>" rel="lightbox"><?php echo wp_get_attachment_image( $image->ID, 'thumbnail' ); ?></a>

    Thread Starter Oscar

    (@chasix)

    Works great!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Taxonomy and Lightbox’ is closed to new replies.