WordPress.org

Ready to get started?Download WordPress

Forums

Lightbox Plus Colorbox
caption from WP galleries (16 posts)

  1. steveredshaw
    Member
    Posted 1 year ago #

    I am creating galleries from WP upload media facility and have enabled LightBox Plus to display them. I have ticked the box 'Use WP captions as LBP captions' however the captions do not show upon the lightbox displays in any Style I have tested.

    I have tried deactivating other plug-ins, but still no change.

    Has anyone else had this problem and any ways round it or maybe I haven't clicked the right settings... thanks

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

  2. reiziuh
    Member
    Posted 1 year ago #

    Yeah, This function works well on previous version. But after update, it doesn't work. All the captions disappeared. Does anybody know how to fix it?
    Thanks.

  3. reiziuh
    Member
    Posted 1 year ago #

    I recovery the lightbox plus 2.5.5. It works again.

  4. steveredshaw
    Member
    Posted 1 year ago #

    how did you get 2.5.5, I only have 2.6 as that is now in the WordPress repository

  5. reiziuh
    Member
    Posted 1 year ago #

    I recovered it from the backup file. You can search that version on Google.
    I found this via google search: http://techniki.com/zh/?option=com_sobipro&pid=1&sid=5450:Lightbox-Plus&Itemid=170 You can give it a try.

  6. steveredshaw
    Member
    Posted 1 year ago #

    thanks, that link led to a page with a download link, but the link led to the current Lightbox Plus download, 2.5.5

    I may have a backupfile, 'cos I did have captions showing, then I think I deleted the plug-in then decided to reinstall it, but I don't know how to restore anything from a WordPress backup(?)

    alternatively;
    do you have a zip file of version 2.5.5 by any chance? I'd really like to get captions showing on my gallery displays!!

  7. AdrianB
    Member
    Posted 1 year ago #

    I was just going to open a thread about the same question. I havn't used any previous version but I would like to be able to use the image caption from the gallery instead of the image title.

    (By the way, it's easy to get 2.5.5 or any older version, just change the URL like this: http://downloads.wordpress.org/plugin/lightbox-plus.2.5.5.zip)

  8. steveredshaw
    Member
    Posted 1 year ago #

    thanks for tip about getting previous versions. I have reverted to 2.5.5, but still no captions - this is strange, when I first started using Lightbox Plus I was getting the WP captions displayed on the Lightbox image displays, but I can't recall what version this was

    if the problem is not the version, what else could be preventing the plug-in displaying WP captions if that option is selected from the plug-in settings?

  9. hartley_h
    Member
    Posted 1 year ago #

    I think I've identified one of two problems with the 2.6 code. There are two places where "Use WP Caption for LBP Caption" affects what happens. One of those works, the other does not (although there are errors in both). If you check "Auto-Lightbox Text Links" then it uses the first instance of code, which seems to work. If "Auto-Lightbox Text Links" is unchecked, it runs the second instance of code which does not work. That's the work around

    As for the bug in the code...

    The first set of code works but only accidentally, as it turns out. Don't know if the plugin author will see this, but on lines 117 and 120 in classes/filters.class.php there are single equal signs (i.e. assignment operator) where there should be double equal signs (equality operator). For instance:

    if ($e->next_sibling()->class = 'wp-caption-text') {

    should be

    if ($e->next_sibling()->class == 'wp-caption-text') {

    etc. Since both statements return true but since the second one assigns the proper value (at least for me), the code works but, as I said, only accidentally.

    This mistake is repeated on lines 202 and 203. That second set of lines doesn't seem to work for me, even after fixing that, but I haven't quite figured out why.

  10. steveredshaw
    Member
    Posted 1 year ago #

    this is great detective work, I am incredibly grateful as I am not knowledgeable enough to delve into a php file to see what may be amiss!!

    the line in my classes/filters.class.php file was like this (the whole section)

    /*
    * If use caption for title try to get the text from the caption - this could be wrong
                                        */
                                        if ($lightboxPlusOptions['use_caption_title']) {
                                            if ($e->next_sibling()->class == 'wp-caption-text') {
                                                $e->title = $e->next_sibling()->innertext;
                                            }
                                            elseif ($e->parent()->next_sibling()->class = 'gallery-caption') {
                                                $e->title = $e->parent()->next_sibling()->innertext;
                                            }
                                        }

    this shows the amended version (insert ==) and it works if Auto-LightBox Text Links is checked and Do Not Display Image Title: is unchecked

    BTW - in the above code extract should class='gallery caption' also have a double =? (although that does not affect my use of the plug-in I don't think)

  11. hartley_h
    Member
    Posted 1 year ago #

    Yes, the elseif line should also have ==

  12. hcthomas
    Member
    Posted 1 year ago #

    Thanks for the help! Your trick worked perfectly.

  13. sambarluc
    Member
    Posted 1 year ago #

    Unfortunately this doesn't seem to work for me. Captions show up under the thumbnails, but not when I open the gallery. Substituting = with == on those lines gives me some sort of error. Is it connected with the style used? I tried a couple of them, but did not get any caption.

  14. sambarluc
    Member
    Posted 1 year ago #

    Ok, got it, the solution does not work with " Link captions to the image attachment page." Now I don't have links on the captions, but at least I have captions. Thanks!

  15. RogerUsh
    Member
    Posted 1 year ago #

    I added the 2 extra = under:

    * If use caption for title try to get the text from the caption - this could be wrong

    Checked Auto-Lightbox Text Links:

    Unchecked Do Not Display Image Title:

    And it did not work for me.

  16. Alex Hazas
    Member
    Posted 7 months ago #

    I downloaded and installed the old version and did not work, then, I have updated the plugin again and the problem was solved, sorry for my english

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic