How do i add LIGHTBOX to Attachments?

How do i add the light box function

rel=”lightbox”

Read More

to the code below

<a href="<?php echo wp_get_attachment_url($post->ID); ?>" title="<?php echo wp_specialchars( get_the_title($post->ID), 1 ) ?>"><?php echo wp_get_attachment_image($post->ID, 'large' ); ?></a>

Related posts

Leave a Reply

2 comments

  1. i think most lightbox plugins require the rel or class attribute to be on the link, so:

    <a href="<?php echo wp_get_attachment_url($post->ID); ?>" rel="lightbox" title="<?php echo wp_specialchars( get_the_title($post->ID), 1 ) ?>"><?php echo wp_get_attachment_image($post->ID, 'large' ); ?></a>