WordPress.org

Ready to get started?Download WordPress

Forums

WP 2.5 Gallery - Lightbox Option? (17 posts)

  1. CaptainBlue
    Member
    Posted 6 years ago #

    {Hmm. The drop-down selector needs tweaking to add 2.5 lol}

    I've just tried the new gallery option and it looks quite good. It's a disappointment, however, after using the lovely AJAX pop-up when adding images in the editor to find there's no option to display the galleries in a lightbox: looks like it's back to manual edits and a plu-in for me.

    Can I ask for the option at least to include a lightbox option? Something like [ gallery display="lightbox" ]?

  2. 14words
    Member
    Posted 6 years ago #

    Yeah a built in lightbox feature would be great for the gallery instead of going to the attachment id page. I hope a plugin will change this.

  3. mafro
    Member
    Posted 6 years ago #

    I just did a (slightly dirty) hack to get lightbox working. Havent got time to look into building it into a plugin, as Ive never written a plugin before and cant see how I could redefine this function like you can do elsewhere in WP.

    Use this at your own risk!!!

    In wp-includes/post-template.php, line 390 looks like so:

    return "<a href='$url' title='$post_title'>$link_text</a>";

    Replace this line with the following:

    //mafro lightbox mod
    list($url, $w, $h) = wp_get_attachment_image_src($id, "full", $icon);
    
    return "<a href='$url' title='$post_title' rel='lightbox'>$link_text</a>";

    This set the correct link for the image in link tag and add the rel="lightbox" attribute we all know and love.

    In order for this hack to work you will also need this plugin to include lightbox:
    Lightbox 2

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    The gallery code is capable of being replaced by plugins, so expect some plugins out soon that change its behavior. For example, I wrote a quick one over the weekend that displays the gallery images in a coverflow-like manner. It's too ugly for public release yet, of course, but it's easy enough to do that I expect several different gallery plugins will be out soon.

  5. insojourn
    Member
    Posted 6 years ago #

    The hack almost works for me. The lightbox window opens, but for some reason it is truncated (small) and does not show the image. For an example see:
    http://74.54.199.50/~stormrep/blog/?page_id=10

    Any suggestions would be most appreciated!

    sojo

  6. insojourn
    Member
    Posted 6 years ago #

    Update: the Lightview-plugin, newly updated for 2.5 works perfectly with this hack.

    http://wordpress.org/extend/plugins/lightview-plus/

  7. noelgreen
    Member
    Posted 6 years ago #

    Works perfect! Thanks!!

  8. ipmast
    Member
    Posted 6 years ago #

    thanks for the hack!
    also works with Slimbox Plugin

    just replace rel='lightbox' with rel='lightbox[roadtrip]'

    and yes, a plugin would be cool ;-)

  9. shini
    Member
    Posted 6 years ago #

    Thanks a lot for the hack! works beautifully..

  10. sammyb
    Member
    Posted 6 years ago #

    This plugin adds rel="lightbox" to the new gallery feature in WP 2.5. It also adds it to all image links within posts and pages, and adds the lightbox js too (using jQuery Lightbox).

    WP 2.5 Gallery Lightbox Plugin

  11. noelgreen
    Member
    Posted 6 years ago #

    This stopped working.
    And sammyb, your plugin won't work either.
    That's since today's upgrade to 2.5.1

    Any ideas?

  12. noelgreen
    Member
    Posted 6 years ago #

    Actually, sammyb, yours does work with the above hack. :)
    But I like the "Lightview Plus" plug-in better... (no offense).
    Anyone know why it's not working now?

  13. noelgreen
    Member
    Posted 6 years ago #

  14. hawkwood
    Member
    Posted 6 years ago #

    I just released a plugin, gallery-plus, that can add the lightbox attribute to the gallery. You need to install the lightbox 2 plugin also. I personally use version 2.6.0.

  15. serialboxhpc
    Member
    Posted 6 years ago #

    mafro your solution worked perfectly. exactly what I wanted to do.

  16. pmdci
    Member
    Posted 6 years ago #

    I agree! I found really weird that there is thickbox being used in the editor (when browsing media files) but yo don't have the option to use it with the [gallery] shortcode.

    I made a feature request here:
    http://wordpress.org/support/topic/187603

  17. dig1618
    Member
    Posted 5 years ago #

    i just used mafrolightboxmod in wp2.7.1. it kinda works.

    the noelgreenmod didn't.

Topic Closed

This topic has been closed to new replies.

About this Topic