[resolved] [closed] Found a Bug? - Media - Lightbox isn't working (21 posts)

  1. klartext-ne
    Posted 3 years ago #

    Hi, i try my best to explain this in English.

    At first I'm using a Lightbox to show my pictures. I tried several, now i use WP Slimbox2. After I've updated from 3.4.2 to 3.5.1 i found a very strange behavior. My Lightbox wasn't working anymore. But only when I tried to open a picture form a gallery. A single pic worked fine.

    So when i click to open a gallery picture the attachment side opens, exact with that picture. But the Lightbox should do so. I was confused.
    But if i click the picture (attachment side) the Lightbox works again. Ooops???

    Ok, enough small talk.

    I fond out:
    Usually the picture link contains this: rel="lightbox[12345]"

    It's so if you upload only 1 picture.
    But if you upload a gallery it isn't!! This part is missing.

    As i wrote before i tried several Lightbox plugins. And it works fine until 3.5.X update. So i think this must be WP bug!

    To find out if this is a plugin fault I've installed WP 3.5.1 totally new, no other plugins and tried it again. Same error again!

    See here: http://www.klartext-ne.de/2013/02/03/grevenbroich-balluebergabe-in-der-mobilen-jugendarbeit/

  2. klartext-ne
    Posted 3 years ago #

    Ok tried 3.4.2

    It works fine!

    This is a 3.5.x Bug !!

  3. WordPress out of the box doesn't do lightbox so I'm not sure how that can be considered a 3.5.1 bug.

    Which lightbox plugin are you using that works in 3.4.2 but not 3.5.1? That information will probably help others assist you in finding a fix.

  4. klartext-ne
    Posted 3 years ago #

    Hi Jan,
    as i wrote it's WP-Slimbox2. But i tries several. All the same.
    Check out the link I've posted. Click the single picture and the lightbox opens.

    Try the gallery pictures (3) and you'll see what happens. No lightbox and redirected to the picture site. And then click again and voila: Lightbox.

    No problem in 3.4.2

  5. klartext-ne
    Posted 3 years ago #

    In the gallery link you won't find: rel="lightbox[12345]". But you'll do in the single picture link.

    This happens several times in every lightbox plugin i tried (4). So this is a WP 3.5.1 Bug.

  6. WPyogi
    Forum Moderator
    Posted 3 years ago #

    It's more likely that the plugin(s) has a compatibility problem (probably javascript) with 3.5.1 -- note that it has not been updated in some time:


  7. klartext-ne
    Posted 3 years ago #

    Could be. But I've tried:

    Fancy Box - Compatible up to: 3.5.1
    WP Lightbox 2 - Compatible up to: 3.5.1
    Lightbox Plus ColorBox - Compatible up to: 3.6-alpha

    All the same problem!

    Don't try to blame the plugins. There is something wrong in WP 3.5.1.

  8. WPyogi
    Forum Moderator
    Posted 3 years ago #

    Do those problems happen in the default WP theme (twentytwelve) with all other plugins deactivated?

  9. Mark Ratledge
    Forum Moderator
    Posted 3 years ago #

    @klartext-ne said:

    Don't try to blame the plugins. There is something wrong in WP 3.5.1.

    No, there is not a bug in WP 3.5.1 concerning lightbox.

    This happens several times in every lightbox plugin i tried (4).

    This happens several times in every lightbox plugin i tried. That's the operative word here: plugin.

    This is simply a plugin issue with a plugin that is not maintained and/or updated for WP 3.5+.

    This could also be an issue with your third party there. This where you got your theme: http://www.der-prinz.com/branfordmagazine-wordpress-magazine-style-theme/ Check to see if there is an update.

  10. klartext-ne
    Posted 3 years ago #

    No nothing is wrong - its all about the plugins or themes.

    WP 3.5.1 - Twenty Twelve
    NO plugins except WP-Slimbox2

    check here

    Nothing happens. No Lightbox - no rel="lightbox[12345]" in the link.

    And now??

  11. Drew Jaynes
    Docs Czar
    Posted 3 years ago #

    Nothing happens. No Lightbox - no rel="lightbox[12345]" in the link.

    And now??

    Hi klartext-ne,

    I just tested WP-Slimbox2 on a 3.5.1 test build with Twenty Twelve and got it to work fine with a gallery.

    Two things:

    1. When selecting gallery options, be sure to select Link to Media file
    2. If the [gallery ids="----"] shortcode doesn't contain link="file", make sure it does. Such as [gallery link="file" ids="----"]

    There's a bug with link="file" not being correctly added to gallery shortcodes in 3.5.1. See here: #23298

  12. Edit: I'm pretty sure Drew is right. On my test install it took me 2 or 3 tries to get the gallery to actually link to the media instead of the attachment page. Once it started working then it stayed working for me.

    - - - - - -

    I don't think it's not a bug exactly, can you confirm how you are adding those images?

    Visit this link as an example.


    See the first image (*COUGH* of the amazingly confident looking person *COUGH!*) on top? Click that and you'll see the link goes to the attachment page. That link is this one.


    See the second image (of the lady who has infinite patience with me)? That brings up the lightbox and that link is this one.


    It uses the lightbox for me because I've activated the same plugin you are using which is WP-Slimbox2.

    Looking at your example page I see that the images are referring to the following URLs.


    None of which are the media URL and will not work for that plugin.

    Can you post a simple single image and confirm that it's pointing to the media such as this URL:


    That should work with that plugin if you can get it to link to the straight image URL like that.

  13. klartext-ne
    Posted 3 years ago #

    Thank you all. I'm writing from Germany so we have differed time zones.

    This is what i found out. I've installed WP 3.4.2 and WP-Slimbox2 (or one of the others). Uploaded a gallery choosing Media file as target (as I always do). No problems, lightbox is working fine.

    Next i updated to 3.5.1. Lightbox is working fine (oops?). After this I've uploaded a new gallery. Same problem! NO lightbox. So i think there should be something wrong.

    I'm only a user. I don't have any further knowledge about coding.
    1. I always do so.
    2. How can i do this?

    the neu.xxx is only my testing site.

    Check this pls:

    The single pic is working fine, as usual. Then try the gallery (3 files). No lightbox function. Uploaded after update to 3.5.1.

    Pic Link (gallery):
    Try this:
    Pic Link (gallery):

    Same problem
    But then here:

    Pic Link (gallery):

    The last link is pointing to a *.jpg. In the last two galleries not. All these galleries where uploaded after the update.

    Here i had some problems. First i tried to build two galleries. Separate before/ after pics. This doesn't worked. One gallery had a lightbox the other not. So i joined both and, i don't know how, the lightbox appears.

    I think this (wrong/ incomplete links) could be the problem. How can i fix this??

    Is this "my" problem?
    There's a bug with link="file" not being correctly added to gallery shortcodes in 3.5.1. See here: #23298

    I've tried this here:

    No, same problem

  14. klartext-ne
    Posted 3 years ago #

    Ok, maybe this fixes the problem. At testing site the link seems to be correct now.

    I'll try this now in main page

    HEUREKA!!! Fixed!!!!

  15. klartext-ne
    Posted 3 years ago #

    Well done.

  16. liquidblue
    Posted 3 years ago #

    I agree possible bug...

    1. When we add a new post and Create A Gallery upload 3 images
    the default is MEDIA FILE 3 columns.

    2. When inserted in TEXT view the code doesn't contain link="file"
    (So by default its not working)

    Simple fix is to toggle to Attachment page insert
    then go back and toggle back to Media File and update.

    and it places the correct link="file" in code.

    Please fix. see here as well

  17. klartext-ne
    Posted 3 years ago #

  18. liquidblue
    Posted 3 years ago #

    Thank you... I am working this patch now.

    Question: the patch uses "Post" selected.
    We would prefer the default to be File.
    when I do this below it still doesn't initially insert.

    <option value="post">
       <?php esc_attr_e('Attachment Page'); ?>
    <option value="file" selected>
       <?php esc_attr_e('Media File'); ?>

    but still by default inserted gallery still will not add link="file"
    unless I pull down the select menu and toggle it.

    Kinda need it to default and insert without user intervention?

  19. susafri
    Posted 3 years ago #

    @klartext: could you please tell me how you got this to work?

  20. klartext-ne
    Posted 3 years ago #

    Hi, you've to change two files.

    1. wp-includes/js/media-editor.js
    2. wp-includes/media-template.php

    Follow this instructions:
    red means: delete this part
    green means: this is new

  21. susafri
    Posted 3 years ago #

    Thank you! I just discovered this. and it did fix the issue with diplaying the image instead of the page. However isn't the slideshow functionality supposed to automatically start in 3.5.1? If I click on the thumbnail it opens but I cannot navigate to the next imnage.

Topic Closed

This topic has been closed to new replies.

About this Topic