Title: Hack to Adding  rel=&#8221;lightbox&#8221; in 2.5.1
Last modified: August 19, 2016

---

# Hack to Adding rel=”lightbox” in 2.5.1

 *  Resolved [bohoe](https://wordpress.org/support/users/bohoe/)
 * (@bohoe)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/)
 * Hi
 * Im looking for a hack to add rel=”lightbox” to the 2.5.1 when adding images or
   any other media to a post. Any ideas? I think something could be done in media-
   upload.php but not sure.
    (I tried using ‘Lightbox 2’ and ‘Add lightbox’, but
   it aint working in 2.5.1)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [muten](https://wordpress.org/support/users/muten/)
 * (@muten)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761307)
 * The nextgen gallery plugin does that for you… I cant seem to get it working on
   my newest project fully – but I used it last week on a clients site and it worked
   very nicely.
 *  Thread Starter [bohoe](https://wordpress.org/support/users/bohoe/)
 * (@bohoe)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761403)
 * Hi Muten
 * Thanks, but I dont need a gallery.
    All I want is the lightbox script to work
   on 2.5.1 Is there anybody there that has the plugin ‘Lightbox 2’ or ‘Add lightbox’
   working on a 2.5.1?
 * Can anyone, including the gurus, let me know where to add rel=”lightbox[ID-OF-
   THE-POST]” in my WP files so I can add the lightbox script outside the plug-ins
   structure, in the html head, and force the links to use it?
 * I would love you forever!
 *  Thread Starter [bohoe](https://wordpress.org/support/users/bohoe/)
 * (@bohoe)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761404)
 * I found this post in the forums [http://wordpress.org/support/topic/171903?replies=5](http://wordpress.org/support/topic/171903?replies=5)
 * I actually had to Google it, as WP forums’ search wasnt really helpful. Will 
   try it and come back here to let everyone know if it works.
 * Cross your code!
 *  Thread Starter [bohoe](https://wordpress.org/support/users/bohoe/)
 * (@bohoe)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761405)
 * Nop, it doesnt work.
 * Lightbox and 2.5.1 are no good friends.
 *  Thread Starter [bohoe](https://wordpress.org/support/users/bohoe/)
 * (@bohoe)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761406)
 * Ok, there was an issue with Ajax Comments posting. Once that plug-in was off,
   all worked.
 * I added
 *     ```
       //mafro lightbox mod
       list($url, $w, $h) = wp_get_attachment_image_src($id, "full", $icon);
       $post_id = get_the_ID();
       return "<a href='$url' title='$post_title' rel='lightbox[$post_id]'>$link_text</a>";
       ```
   
 * to my wp-includes/post-template.php
 *  [hearkening](https://wordpress.org/support/users/hearkening/)
 * (@hearkening)
 * [18 years ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761507)
 * Bohoe: right, but where did you add this in the post-template.php and what did
   you replace?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Hack to Adding rel=”lightbox” in 2.5.1’ is closed to new replies.

 * 6 replies
 * 3 participants
 * Last reply from: [hearkening](https://wordpress.org/support/users/hearkening/)
 * Last activity: [18 years ago](https://wordpress.org/support/topic/hack-to-adding-rellightbox-in-251/#post-761507)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
