The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Hack to Adding rel="lightbox" in 2.5.1 (7 posts)

  1. bohoe
    Posted 8 years ago #


    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)

  2. Muten
    Posted 8 years ago #

    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.

  3. bohoe
    Posted 8 years ago #

    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!

  4. bohoe
    Posted 8 years ago #

    I found this post in the forums 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!

  5. bohoe
    Posted 8 years ago #

    Nop, it doesnt work.

    Lightbox and 2.5.1 are no good friends.

  6. bohoe
    Posted 8 years ago #

    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

  7. hearkening
    Posted 8 years ago #

    Bohoe: right, but where did you add this in the post-template.php and what did you replace?

Topic Closed

This topic has been closed to new replies.

About this Topic