Title: Trigger CMB2 Multi files
Last modified: September 2, 2016

---

# Trigger CMB2 Multi files

 *  Resolved [csjWP](https://wordpress.org/support/users/csjwp/)
 * (@csjwp)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/trigger-cmb2-multi-files/)
 * Hi,
 * First off let me apologies if this question have been asked before. I tried looking
   for it.
 * I don’t know if you are familiar with [CMB2](https://github.com/WebDevStudios/CMB2/wiki),
   but I’ve added a [Multi Files metabox](https://github.com/WebDevStudios/CMB2/blob/master/example-functions.php#L386-L392)
   for creating a image gallery. I’ve added this code to my template-tags.php and
   content-cpt.php file.
 * Everything works, the images are outputted to the page. But I can’t find a way
   to add the data-featherlight trigger. The images gets outputted as img scr and
   not a href.
 * The closet I’ve come is to make the div trigger. But it doesn’t trigger the images.
 *     ```
           echo '<div class="file-list-image">';
           echo '<div data-featherlight>';
           echo wp_get_attachment_image( $attachment_id, $img_size );
           echo '</div>';
           echo '</div>';
       ```
   
 * I can’t figure out how to add the data-featherlight to the image link markup.
 * If you have time, do you have any ideas or advice?
 * Thank you.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Robert Neu](https://wordpress.org/support/users/fatmedia/)
 * (@fatmedia)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/trigger-cmb2-multi-files/#post-8420743)
 * It sounds like you might need to make that div into a gallery using the `data-
   featherlight-gallery` attribute. Here’s more information about how to create 
   a gallery: [https://github.com/noelboss/featherlight/#gallery-configuration](https://github.com/noelboss/featherlight/#gallery-configuration)

Viewing 1 replies (of 1 total)

The topic ‘Trigger CMB2 Multi files’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-featherlight_121e24.svg)
 * [WP Featherlight - A Simple jQuery Lightbox](https://wordpress.org/plugins/wp-featherlight/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-featherlight/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-featherlight/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-featherlight/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-featherlight/reviews/)

## Tags

 * [trigger](https://wordpress.org/support/topic-tag/trigger/)

 * 1 reply
 * 2 participants
 * Last reply from: [Robert Neu](https://wordpress.org/support/users/fatmedia/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/trigger-cmb2-multi-files/#post-8420743)
 * Status: resolved