[Plugin: Lightbox 2] "lightbox2 automatically" – how to exclude some images?
-
Hello,
the plugin works OK in WP3.2.1 and the option ‘Add rel=”lightbox[]” to all linked images’ is very nice. Nevertheless, is there any possibility to EXCLUDE some if linked images in the page/post from this “auto-add” option?I tried to add something like rel=”false” to these items manually, but the only result is nonvalid code:
rel=”false” rel=”lightbox[]”It seems the hack have to be done in regular expressions for adding of the lightbox[] string:
$pattern = “/(<a(?![^>]*?rel=[‘\”]lightbox.*)[^>]*?href=[‘\”][^’\”]+?\.(?:bmp|gif|jpg|jpeg|png)[‘\”][^\>]*)>/i”;
$replacement = ‘$1 rel=”lightbox[‘.$post->ID.’]”>’;
$content = preg_replace($pattern, $replacement, $content);Do you have any idea?
Thank yoe very much,
with best regard, Joo
- The topic ‘[Plugin: Lightbox 2] "lightbox2 automatically" – how to exclude some images?’ is closed to new replies.