• Resolved thouston

    (@thouston)


    If I have an image within a table I’d like it to use the auto lightbox feature when it’s clicked. I know the plugin is working on the rest of the site, but if the image is within a table it doesn’t lightbox at all.

    If this is something to do with the way the table is generated, is there a manually forcing I can do?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    how is the Lightbox effect invoked?
    Do you manually add something like rel="lightbox" to the HTML of images or hyperlinks, or is this done via JavaScript?
    If you manually need to add that HTML argument, you will also have to do so in the links/images within the table.

    Which Lightbox plugin are you using?

    Regards,
    Tobias

    Thread Starter thouston

    (@thouston)

    Thanks Tobias. I’m using Lightbox plus and I don’t have to do anything to the images, they just automatic get lightboxed so I guess it’s done via Javascript.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the plugin name. I just checked it out.
    The rel code from above is added through a filter on the post content. Unfortunately, that filter runs before Shortcodes (including the [table] Shortcode) are executed. Because of that, images in tables are not recognized by the plugin.

    However, this can easily be fixed with a slight change in the “Lightbox Plus” plugin.
    Please open the file “lightboxplus.php” in the “lightbox-plus” folder and change line 138 from

    add_filter( 'the_content', array( &$this, 'filterLightboxPlusReplace' ) );

    to

    add_filter( 'the_content', array( &$this, 'filterLightboxPlusReplace' ), 12 );

    (note the 12 at the end, which will tell WordPress to execute that filter function after WordPress Shortcodes are evaluated).

    Best wishes,
    Tobias

    Thread Starter thouston

    (@thouston)

    I’ll sort that in the morning.

    Tobias you really are a star for helping with this sort of thing – way beyond what I’d expect. I appreciate your help and you can expect another donation once my client signs off this latest site!

    Thread Starter thouston

    (@thouston)

    PS: Such a little change I couldn’t help trying it tonight – that works a treat!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    awesome! ?? Great to hear that this worked so nicely!

    (Just a reminder: You likely will have to re-apply that tiny change whenever the Lightbox Plus plugin gets an update.)

    And thanks for your willingness to donate, I really appreciate it!

    Best wishes,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Wp-Table Reloaded] lightbox images’ is closed to new replies.