Title: [Plugin: WP jQuery Lightbox] Galleries with custom fields
Last modified: August 20, 2016

---

# [Plugin: WP jQuery Lightbox] Galleries with custom fields

 *  [pereiraeduardo](https://wordpress.org/support/users/pereiraeduardo/)
 * (@pereiraeduardo)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-jquery-lightbox-galleries-with-custom-fields/)
 * Hi.
 * I’m working with the plugin using custom fields, and i would like to know if 
   it is possible to create a gallery between the images i add. Here’s the code 
   i’m using:
 *     ```
       $key = "Galeria" ; $gallery = get_post_meta ( $post->ID , $key , true );
       if ($gallery != "") {
       									// Separate our comma separated list into an array
       									$gallery = explode(",", $gallery);
       									//loop through our new array
       									foreach ($gallery as $picture) {
       									  echo '<a href="'.$picture.'" rel="lightbox[Galeria]"><img src="'.$picture.'"></a>';
       									}
       }
       ```
   
 * As you can see, i try “rel=’lightbox[Galeria]'”, but the images don’t link between
   them. Even if add only two images in HTML:
 *     ```
       <a href="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg" rel="lightbox[109]"><img src="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg"></a>
       							<a href="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg" rel="lightbox[109]"><img src="http://localhost/fdm/wp-content/uploads/2012/02/mel-07-05-05_2212.jpg"></a>
       ```
   
 * Sorry bother
 * [http://wordpress.org/extend/plugins/wp-jquery-lightbox/](http://wordpress.org/extend/plugins/wp-jquery-lightbox/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-jquery-lightbox-galleries-with-custom-fields/#post-2641205)
 * You’re doing it right. All links-to-images sharing the same rel=”lightbox[something]”
   will be put into a group.
 * Something else is probably wrong here.
 *  Thread Starter [pereiraeduardo](https://wordpress.org/support/users/pereiraeduardo/)
 * (@pereiraeduardo)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-jquery-lightbox-galleries-with-custom-fields/#post-2641223)
 * I don’t understand this behavior. It only apply a group if i create a gallery
   on the content field. Just for the record, i’m using toolbox theme and 2 other
   plugins :
    - JwPlayer
    - Contact Form 7
 * Thanks for the quick answer.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WP jQuery Lightbox] Galleries with custom fields’ is closed 
to new replies.

 * ![](https://ps.w.org/wp-jquery-lightbox/assets/icon-256x256.png?rev=3274178)
 * [LightPress Lightbox](https://wordpress.org/plugins/wp-jquery-lightbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-jquery-lightbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-jquery-lightbox/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-jquery-lightbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-jquery-lightbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-jquery-lightbox/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [pereiraeduardo](https://wordpress.org/support/users/pereiraeduardo/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-jquery-lightbox-galleries-with-custom-fields/#post-2641223)
 * Status: not resolved