Categories
General

Photopress and Lightbox 2

Thanks to Steven for telling me about this issue!

Lightbox 2 has a cool feature where it’ll automagically add code to images in your posts so they’ll work with Lightbox. This is great until it runs into the Photopress album and breaks stuff. To fix this easily, you can turn off the auto-lightbox feature in the Lightbox 2 settings. But what if you like auto-lightboxing?

The function that does auto-lightboxing is around line 60 of lightbox2.php. Adding this “if” to detect the Photopress album (actually “pp_wrap”) and avoid auto-lightboxing seems to do the trick:

function autoexpand_rel_wlightbox ($content) {
/*add this--->*/ if ( strstr($content, 'pp_wrap') ) { return $content; }

Of course, then you’d need to re-do this hack every time you upgrade Lightbox 2…

Avatar photo

By isaac

I like cats. he/him