title: WP: acf image fields & simple lightbox plugin integration
body: <p>I'm trying to integrate the Simple Lightbox plugin into Advanced Custom Fields image fields.</p>
  
  <p>Basically I want any images on a page (populated via acf image fields) to open in the lightbox when clicked, and also be grouped together with all other images within the lightbox so they can be navigated through like a slideshow.  This is built-in functionality for the Simple Lightbox plugin, but I don't know how to integrate it with my template code for image fields.</p>
  
  <p>For acf WYSIWYG fields I'm using this...</p>
  
  <pre><code>&lt;?php
      $content = get_field('wysiwyg');
      if ( function_exists('slb_activate') )
      $content = slb_activate($content);
      echo $content;
  ?&gt;
  </code></pre>
  
  <p>...which works great, but adapting that to image fields is eluding me.</p>
  
  <p>Here's my template code for image fields (without any attempts at integrating Simple Lightbox):</p>
  
  <pre><code>&lt;?php
      $image = get_field( 'img' );
  
      if( ! empty( $image ) ) {
      $url    = $image['url'];
      $alt    = $image['alt'];
      $caption = $image['caption'];
      $size   = 'large';
      $thumb    = $image['sizes'][ $size ];
      $width  = $image['sizes'][ $size . '-width' ];
  ?&gt;
  
  &lt;?php if( $caption ): ?&gt;
  
      &lt;div class="wp-caption" style="width: &lt;?php echo $width; ?&gt;px"&gt;
  
  &lt;?php endif; ?&gt;
  
  &lt;a href="&lt;?php echo $url; ?&gt;"&gt;
  
      &lt;img src="&lt;?php echo $thumb; ?&gt;" alt="&lt;?php echo $alt; ?&gt;" /&gt;
  
  &lt;/a&gt;
  
  &lt;?php if( $caption ): ?&gt;
  
          &lt;p class="wp-caption-text"&gt;&lt;?php echo $caption; ?&gt;&lt;/p&gt;
  
      &lt;/div&gt;
  
  &lt;?php endif; ?&gt;
  
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Any suggestions for how to integrate Simple Lightbox into this? Thanks in advance!</p>