Title: DefProc's Replies | WordPress.org

---

# DefProc

  [  ](https://wordpress.org/support/users/defproc/)

 *   [Profile](https://wordpress.org/support/users/defproc/)
 *   [Topics Started](https://wordpress.org/support/users/defproc/topics/)
 *   [Replies Created](https://wordpress.org/support/users/defproc/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/defproc/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/defproc/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/defproc/engagements/)
 *   [Favorites](https://wordpress.org/support/users/defproc/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/users/defproc/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/defproc/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] This plugun doesn't work](https://wordpress.org/support/topic/this-plugun-doesnt-work/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/this-plugun-doesnt-work/#post-5238888)
 * This plugin will only add rel=”lightbox” to images from your media library. If
   you add it manually, it will not change those links.
 * If you have added rel=”lightbox” to an image link, but there’s no popup when 
   you click it, do you have a lightbox/slimbox plugin installed on your site? This
   plugin only automates adding the effect, but doesn’t add the lightbox javascript—
   you’ll need to do that separately.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] Multiple images](https://wordpress.org/support/topic/multiple-images-4/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/multiple-images-4/#post-4416159)
 * On the main page of the site you link, add-rel-lightbox is doing what I’d expect.
   If I click on any of the images, there’s a “prev”/”next” overlay when you move
   the mouse to the left or right side of an image respectively.
 * It’s not possible to automatically show the images simultaneously in add-rel-
   lightbox, you’d have to create a composite image or a page and add `rel=lightbox`
   as a link attribute.
 * Are you thinking of having a set of images pop up in the lightbox like is shown
   on the main page so you can click each one to make it larger again? It’s not 
   normally best practice to show pages inside pages on websites, it makes them 
   more difficult to navigate (as a link doesn’t change the page) and makes them
   less readable and searchable by hiding content.
 * Does that help?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] Multiple images](https://wordpress.org/support/topic/multiple-images-4/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/multiple-images-4/#post-4416091)
 * Assuming all the images have been uploaded and selected usign the add media dialog;
   all of the images that are visible in each post are automatically assigned to
   the same gallery. You can go through the gallery by clicking the forward and 
   backward buttons in slimbox.
 * Is this what you mean?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] slimbox2 featured image support](https://wordpress.org/support/topic/slimbox2-featured-image-support/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/slimbox2-featured-image-support/#post-4220021)
 * The usual reasons for lightbox failing are :
 *  1. Malformed html on the page. Lightbox will need a link wrapped image with 
   an image target (add-rel-lightbox checks for the file suffix) to work as expected.
   
   2. The lightbox attribute is not correctly applied. 3. Lightbox is not loaded
   on the page.
 * From a quick look at [the_post_thumbnail](http://codex.wordpress.org/Function_Reference/the_post_thumbnail)
   page you could add the lightbox attribute in post.php (and add-rel-lightbox will
   ignore this link when it parses):
 *     ```
       <?php
        if ( has_post_thumbnail()) {
          $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
          echo '<a href="' . $large_image_url[0] . '" title="' . the_title_attribute('echo=0') . '" rel="lightbox" >';
          the_post_thumbnail('thumbnail');
          echo '</a>';
        }
        ?>
       ```
   
 * Does that help?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] slimbox2 featured image support](https://wordpress.org/support/topic/slimbox2-featured-image-support/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/slimbox2-featured-image-support/#post-4219989)
 * It adds rel=”lightbox” when the page is rendered, so it should be one of the 
   last things to happen.
 * Do you have an example page or some code that I could see so I understand what
   you’re attempting? (email [contact@def-proc.co.uk](https://wordpress.org/support/users/defproc/replies/contact@def-proc.co.uk?output_format=md)
   if you’d rather it be private)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] Not working in v3.5?](https://wordpress.org/support/topic/not-working-in-v35/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/not-working-in-v35/#post-3334184)
 * [@drain0](https://wordpress.org/support/users/drain0/): what form of the gallery
   shortcode are you using? If you use `[gallery]` then add-rel-lightbox won’t do
   anything because this returns a page address. Using `[gallery link=file]` will
   ensure it gives the file address.
 * For my installation, I’ve been using the [Slimbox Plugin](http://wordpress.org/extend/plugins/slimbox-plugin/)
   as all it really does is add the script tags to the page header (adding these
   to the theme is the best solution). Unfortunately it also contains the following
   lines that conflict with add-rel-lightbox, so I’m running a customised version
   without them.
 *     ```
       function slimbox_create($content){
       return preg_replace('/<a(.*?)href=(.*?) (jpg|jpeg|png|gif|bmp|ico)"(.*?)>/i', '<a$1href=$2.$3" $4 rel="lightbox[roadtrip]">', $content);
       }
       add_filter('the_content', 'slimbox_create', 12);
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] Not working in v3.5?](https://wordpress.org/support/topic/not-working-in-v35/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/not-working-in-v35/#post-3334129)
 * Thanks very much. Glad I could help. 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] Not working in v3.5?](https://wordpress.org/support/topic/not-working-in-v35/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/not-working-in-v35/#post-3334078)
 * I’ve tried adding images as normal from the media interface in WP3.5 — both singly
   and in galleries — and it’s all working for me. The plugin only changes the post/
   page content when the page is rendered for the visitor, no changes are made to
   the stored version of the post/page.
 * Do you still have a problem of the links not appearing as expected if add-rel-
   lightbox is disabled?
 * Do you have any other plugins that operate on the images? For instance, the Slimbox
   Plugin that I use has a basic `preg_replace()` for images that I have manually
   disabled to stop it interfering with add-rel-lightbox.
 * Or do you have a page online that I can see the problem you’re having and see
   if I can see the fault? email to contact [at] def-proc.co.uk if you’d don’t want
   to post the link in this forum.
 * Does that help?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] Not working in v3.5?](https://wordpress.org/support/topic/not-working-in-v35/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/not-working-in-v35/#post-3333994)
 * I hadn’t noticed the problem, as haven’t created any posts with images in 3.5
   yet. It’s quite possible that the image attributes have been changed when the
   image is inserted (which won’t affect earlier posts) so I’ll have a look and 
   see if I can see what’s happening.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[TweetUpdater] TweetUpdater and Forum Replies](https://wordpress.org/support/topic/tweetupdater-and-forum-replies/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/tweetupdater-and-forum-replies/#post-3287375)
 * Are you using something like bbPress? I haven’t used tweetupdater with any of
   the forum plugins, so I’ve no idea how they behave.
 * However, you can limit the types of posts that are in a certain category, or 
   have a specific custom field/value pair.
 * From the TweetUpdater Options page, check “Limit Twitter updates using the rules
   below?” and select either:
    - all of the categories that don’t relate to forum posts,
    - or set a “Custom Field Title (key)” (i.e. “TweetIt”) and include that in any
      new post that you make to have it tweeted.
 * Does that help?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] [Plugin: add-rel-lightbox] Problem with 0.4: Line breaks disappear](https://wordpress.org/support/topic/plugin-add-rel-lightbox-problem-with-04-line-breaks-disappear/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-add-rel-lightbox-problem-with-04-line-breaks-disappear/#post-2923289)
 * Ah that explains the problems I’ve been seeing with multiline code&pre tags being
   concatenated to one line!
 * Turns out it’s the Simple DOM Parser again. It defaults to auto-closing tags 
   and will collapse multiline tags to do it. I’ve changed this behaviour for version
   0.4.1 and that sorts it for me.
 * Does that help?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] [Plugin: add-rel-lightbox] how to use plugin with gallery tag in template file](https://wordpress.org/support/topic/plugin-add-rel-lightbox-how-to-use-plugin-with-gallery-tag-in-template-file/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-add-rel-lightbox-how-to-use-plugin-with-gallery-tag-in-template-file/#post-2951318)
 * If you’ve got a `[gallery]` shortcode outside of `the_content`, then you’ll need
   to add a filter to the plugin’s code that to pass it the page at the correct 
   time. I don’t know which filter you’ll need (there’s a [Filter reference](http://codex.wordpress.org/Plugin_API/Filter_Reference)
   in the codex) however, if you’re just coding it in one place, it might be easier
   to just embed the code from my plugin straight into your theme.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] [Plugin: add-rel-lightbox] Warning preg_replace](https://wordpress.org/support/topic/plugin-add-rel-lightbox-warning-preg_replace/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [14 years ago](https://wordpress.org/support/topic/plugin-add-rel-lightbox-warning-preg_replace/#post-2790987)
 * Yep, from a quick look, my best guess is that it’s the lack of the precision 
   in the gallery regex. I can’t be sure without seeing the page content without
   add-rel-lightbox activated, to see if it has changed anything, but the gallery
   regex *shouldn’t* match for this page.
 * I think that instead of matching:
 * `<a […]><img […]></a>`
 * it’s actually matching:
 *     ```
       <a […]></a>
       […]
       <img […]>
       […]
       <a […]></a>
       ```
   
 * and because the extra content has some unescaped `/`s in it, it’s breaking the`/(
   pattern)/i` and adding a `/c` inside the pattern. This is an example of why regexes
   are bad for parsing HTML and why the plugin hasn’t reached version 1 yet.
 * I’ve changed to DOM parsing in version 0.4, so the see if an upgrade sorts it
   out.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] [Plugin: add-rel-lightbox] Disable Groups](https://wordpress.org/support/topic/plugin-add-rel-lightbox-disable-groups/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [14 years ago](https://wordpress.org/support/topic/plugin-add-rel-lightbox-disable-groups/#post-2792752)
 * Ah, I see, from the instructions on the [plugin page](http://wordpress.org/extend/plugins/lightbox-plus/),
   lightbox plus works the opposite way to the ones I’ve seen so far. It seems to
   need the unique id to *stop* the grouping:
 * `rel="lightbox[uniqueID|filename]"`
 * how about `rel="lightbox[wp-image-' . $val[5] . ']"` in line 41 to use the image
   post id?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[add-rel-lightbox] [Plugin: add-rel-lightbox] Disable Groups](https://wordpress.org/support/topic/plugin-add-rel-lightbox-disable-groups/)
 *  Plugin Author [DefProc](https://wordpress.org/support/users/defproc/)
 * (@defproc)
 * [14 years ago](https://wordpress.org/support/topic/plugin-add-rel-lightbox-disable-groups/#post-2792748)
 * That seems less than ideal, what lightbox clone are you using? Some allow the
   gallery mode to set as default instead of the single mode.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/users/defproc/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/defproc/replies/page/2/?output_format=md)