Passing parameters to lightbox and fullscreen galleries
Since Themify Framework version 1.3.5, we rolled a new gallery system to all themes that includes both lightbox and fullscreen swipe solutions to display gallery images and also images linked to their file in the content.
The gallery receives several parameters for its initialization, and all of them are accessible and can be modified using a WordPress filter, 'themify_gallery_plugins_args'. Not only you can modify the existing parameters, but you can also add others, useful for example for the fullscreen gallery.
Basic filter usage
In this example we will show the image title in lightbox. By default this is turned off.
1. Create a file named custom-functions.php in your theme root folder
2. Edit it, and paste the following
3. Save the file. If you were editing it locally, upload it by FTP to the theme folder in your server.
Modifiable existing parameters
These are the parameters that can be modified and their corresponding default values:[code type=php]'theme' => 'pp_default'[/code] Sets the lightbox theme. Can be set to [code type=php]'social_tools' => false[/code] Shows basic social buttons in lightbox view [code type=php]'allow_resize' => true[/code] Allows image resizing in lightbox view when viewport is smaller than image [code type=php]'show_title' => false[/code] Shows lightbox title [code type=php]'overlay_gallery' => false[/code] Shows mini gallery over the lightbox [code type=php]'screenWidthNoLightbox' => 600[/code] Screen width after the one lightbox is no longer triggered
Adding new parameters
This is an example for the fullscreen gallery. We will disable the zoom when user double clicks or double taps the image, change the slideshow delay, and the transition speed.
[/code] The fullscreen gallery supports all the parameters for Photoswipe.
Extending look up areas
As an advanced example, let's see how we can tell the gallery system to look up in areas other than the default ones. Note that we're appending these selectors, otherwise the original ones won't work anymore: