WordPress.org

Forums

Responsive Lightbox by dFactory
Image captions have disappeared due to WordPress 3.7 update (20 posts)

  1. evster
    Member
    Posted 1 year ago #

    I wanted to let you know that the captions that appear for the images in the "enlarged" view for several of the gallery themes offered in your plugin have stopped working.

    These captions seem to rely on the title attribute in the image gallery link, and WordPress has stripped out these title attributes in the latest release. See http://core.trac.wordpress.org/ticket/25739.

    This is documented and confirmed within the SwipeBox theme, as I have noticed it across several sites once I updated to WP 3.7.

    If there is an easy way to do a quick manual fix for this issue and you can point me in the right direction that would be awesome.

    Thanks again for your hard work on this great plugin!

    http://wordpress.org/plugins/responsive-lightbox/

  2. dFactory
    Member
    Plugin Author

    Posted 1 year ago #

    Titles are now taken from links, not from images itself. Try modifying that in your theme and it shuld work for all the scripts shipping with Responsive Lightbox.

  3. germars
    Member
    Posted 1 year ago #

    How would you modify that? Can you give an example? Is it code? And where would it go?

    Thank you!

  4. christianthibault
    Member
    Posted 1 year ago #

    I had the same problem. I used this filter in the functions.php file of my theme and it works fine now.

    function modify_attachment_link( $html, $id ) {
    $att_title = get_the_title($id);
    $html = str_replace( '<a href', '<a title="'.$att_title.'" href', $html );
    return $html;
    }
    add_filter( 'wp_get_attachment_link', 'modify_attachment_link', 10, 2);

  5. evster
    Member
    Posted 1 year ago #

    Thanks Christian!

    The script you posted above worked like a charm.

  6. Native Imaging
    Member
    Posted 1 year ago #

    anyway to get this fixed in the next version? really don't wanna have to add functions to each site to get the captions to display correctly... hmmmmmm.

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    @Native Imaging: If you require assistance then, as per the Forum Welcome, please post your own topic.

  8. dFactory
    Member
    Plugin Author

    Posted 1 year ago #

    Native, now captions are taken from link titles, not the image titles. It was an exception with Swipebox script. Now all included script work the same and use link titles. We think it should stay like that, sorry.

  9. 2cats
    Member
    Posted 1 year ago #

    Hi dFactory, just started using your plug-in with the WordPress native gallery to replace NextGen... can you please explain how captions are taken from link titles rather than image titles? (My images do not link to anything.) Where do I enter the text that I want to use for a caption? The "hack" posted by christianthibault works well to bring up the actual image caption, but as with Native Imaging I don't want to use a hack on every site, and it may break at some future date. Thanks!

  10. oscarfroberg
    Member
    Posted 1 year ago #

    Christian, thanks a bunch.

  11. Native Imaging
    Member
    Posted 1 year ago #

    Not really sure what you mean. The plugin doesn't fetch or show any titles or captions since the update.. also, i'm having a bug with the plugin on this site: http://cardinalhomedesigns.com/

    Also, a random bug: the swipebox-overlay is covering up the images... I've tried deactivating all plugins and disabling/clearing caching tools. The only CSS overrides I use are to make the caption container have a height:auto, and transparency of 0.5 so the top & bottom of the image can be seen still, but Im a bit confused why this is happening.

  12. phaser32
    Member
    Posted 1 year ago #

    Hello everytone. This wonderful plugin works without any modification of the code. What You have to do? Once You have added an image You have to click on the edit icon of the image, click on the advanced option tab > scroll down > Advanced Option link (or something like that ....I use Worpdress in Italian :D) and change the Title. Now You have the caption working like a charm!!!
    I hope this helps ..
    Best regards
    Ale

  13. wpmc
    Member
    Posted 1 year ago #

    It doesnt work for me and responsive lightbox developers dont want to fix this problem,
    I dont know why.

    If you know any good lightbox/swipebox plugin let me know.

  14. wpmc
    Member
    Posted 1 year ago #

    Hi Christian,

    You mean I should add it function.php of theme or WordPress files?
    I think this problem is WordPress issue not theme issues.

    For me the problem is not solved yet, the image title doesnt show in the swipebox Im using. plugin developers told me it is because of a change happened in new WP vesrion and plugin developers will not adjust it,

    So I think I should do some changes in WP coding myself but I have no idea how. :/

  15. evster
    Member
    Posted 1 year ago #

    wpmc - You need to add the code that Christian posted into the function.php file of the current WordPress theme that you are running. DO NOT under any circumstances modify the core files of WordPress!

    That is what worked for me. I have not tested and confirmed in WP 3.8 yet, but my guess is that nothing has changed.

  16. wpmc
    Member
    Posted 1 year ago #

    @evster should I add it to function.php of WP or theme? these are different...

  17. WPyogi
    Forum Moderator
    Posted 1 year ago #

    into the function.php file of the current WordPress theme that you are running. DO NOT under any circumstances modify the core files of WordPress!

  18. wpmc
    Member
    Posted 1 year ago #

    Oh yeah, I added to my theme files-> function.php and it is working! problem solved!
    Thanks.

  19. William
    Member
    Posted 1 year ago #

    Can the solution from Christian implemented in the new update?

  20. DreadScott
    Member
    Posted 1 year ago #

    Responsive Lightbox is great, but not being able to display a caption is a significant drawback. Christian's code is helpful, but I wanted to display the Alt text field and not the title field. I modified the code to the following:
    function modify_attachment_link( $html, $id ) {
    $att_alt = get_post_meta($id, '_wp_attachment_image_alt', true);
    $html = str_replace( '<a href', '<a title="'.$att_alt.'" href', $html );
    return $html;
    }
    add_filter( 'wp_get_attachment_link', 'modify_attachment_link', 10, 2);
    Placed it in functions.php and it works well with swipeBox setting.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.