Responsive Lightbox & Gallery


Responsive Lightbox & Gallery allows users to create galleries and view larger versions of images, galleries and videos in a lightbox (overlay) effect optimized for mobile devices.

For more information, check out plugin page at dFactory or see the Live demo on our site.


  • Powerful, but easy to use gallery builder
  • 3 beautiful basic gallery templates – Grid, Slider and Masonry
  • 8 responsive lightbox scripts (SwipeBox, prettyPhoto, FancyBox, Nivo Lightbox, Image Lightbox, Tos “R” Us, Featherlight, Magnific Popup)
  • Create galleries from Media Library or Post attached images
  • Drag n drop reordering of images
  • Gallery picker to insert shortcodes
  • Iframe, Ajax, HTML5 and Inline lightbox content support
  • Advanced pagination, incl. AJAX and infinite scroll
  • Automatically add lightbox to WordPress image galleries
  • Automatically add lightbox to WordPress image links
  • Automatically add lightbox to WordPress video links (YouTube, Vimeo)
  • Automatically add lightbox to widgets content
  • Automatically add lightbox to WordPress comments content
  • WooCommerce product gallery support
  • Visual Composer compatibility
  • Gallery widget
  • Single image widget
  • Option to display single post images as a gallery
  • Option to modify native WP gallery links image size
  • Option to set gallery images title from image title, caption, alt or description
  • Option to force lightbox for custom WP gallery replacements like Jetpack tiled galleries
  • Option to trigger lightbox on custom jquery events
  • Option to conditionally load scripts and styles only on pages that have images or galleries in post content
  • Enter a selector for lightbox
  • Highly customizable settings for each of the lightbox scripts
  • Multisite support
  • Filter hook for embeddding different scripts based on any custom conditions (page, post, category, user id, etc.)
  • .pot file for translations included

Premium Extensions:
Photo & Art bundle
Justified Gallery
Expander Gallery
Hidden Gallery
Masonry Image Gallery
Slider Gallery
Lightcase Lightbox
PhotoSwipe Lightbox
Lightgallery Lightbox
Strip Lightbox
Fancybox Pro

WP Video Lightbox

The WordPress Video Lightbox plugin allows you to embed videos on a page using lightbox overlay display.

This plugin can be used to display images, flash, YouTube, Vimeo, iFrame etc in a lightbox overlay. The embedded videos can be viewed on iPhone and iPad too.

You can embed a vimeo video using the following shortcode in a WordPress post or page:

[video_lightbox_vimeo5 video_id="13562192" width="640" height="480" anchor="click here to open vimeo video"]
[video_lightbox_vimeo5 video_id="13562192" width="640" height="480" anchor=""]

You need to replace the value of “video_id” with your actual vimeo video ID. When a user clicks on the anchor text/image your vimeo video will pop up in lightbox.

You can embed a YouTube video using the following shortcode in a WordPress post or page:

[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor="click here to open YouTube video"]
[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor=""]

You need to replace the value of “video_id” with your actual YouTube video ID. You can also control the size of the lightbox window by customizing the width and height parameters.

When you are using a thumbnail image as the anchor, you can describe it using the “alt” parameter in the shortcode. It helps Search Engines understand what this image is about.

[video_lightbox_youtube video_id="G7z74BvLWUg" width="640" height="480" anchor="" alt="text that describes this image"]

You need to replace the value of “alt” with your own description of the image.


Once you have installed the plugin you can configure some options to customize the popup. The settings menu can be accessed from “Settings->Video Lightbox->prettyPhoto”.

  • Enable prettyPhoto: Check this option if you want to use the prettyPhoto library
  • Animation speed: fast / slow / normal [default: fast]
  • Autoplay slideshow: true / false [default: false]
  • Opacity: Value between 0 and 1 [default: 0.8]
  • Show title: true / false [default: true]
  • Allow resize: Resize the photos bigger than viewport. true / false [default: true]
  • Allow expand: Allow the user to expand a resized image. true / false [default: true]
  • Default width: default width of the lightbox window [default: 640, you can override it using the width parameter in the shortcode]
  • Default height: default height of the lightbox window [default: 480, you can override it using the height parameter in the shortcode]
  • Counter separator label: The separator for the gallery counter in lightbox [default: /]
  • Theme: theme for the lightbox window – Default, Light Rounded, Dark
  • Rounded, Light Square, Dark Square, Facebook
  • Horizontal padding: The padding on each side of the lightbox window [default: 20]
  • Hide Flash: Hides all the flash objects on a page, set to true if flash appears over prettyPhoto [default: false]
    wmode: the flash wmode attribute [default: opaque]
  • Autoplay: Automatically start videos: true / false [default: true]
  • Modal: If set to true, only the close button will close the window [default: false]
  • Deeplinking: Allow prettyPhoto to update the url to enable deeplinking. [default: true]
  • Overlay gallery: If this enabled, a gallery will overlay the fullscreen image on mouse over [default: true]
  • Overlay gallery max: Maximum number of pictures in the overlay gallery [default: 30]
  • Keyboard shortcuts: Set to false if you open forms inside prettyPhoto [default: true]
  • IE6 fallback: compatibility fallback for IE6 [default: true]


  • Automatically retrieve the thumbnail for your video and embed in lightbox
  • Load YouTube video over https. This is great if you have SSL installed on your site
  • Disable suggested videos at the end of a YouTube video
  • Flexiblity of using both shortcode/html code to pop up media in lightbox
  • Show description of a popup in overlay
  • For video tutorial, screenshots, detailed documentation, support and updates, please visit: WP Video Lightbox plugin page

Add responsive full width video on background



#homepage-video {
	&.embed-responsive {
		position: relative;
		display: block;
		height: 0;
		padding: 0;
		overflow: hidden;
	&.embed-responsive .embed-responsive-item,
	&.embed-responsive iframe,
	&.embed-responsive embed,
	&.embed-responsive object,
	&.embed-responsive video {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 100%;
		border: 0;
	&.embed-responsive-16by9 {
		padding-bottom: 35%;
	&.embed-responsive-4by3 {
		padding-bottom: 55%;

Embed Video Player

Video Class code attached. You can put this file in any directory. Previously it was put in a folder called classes.

Calling video class

$link = "";
$embed = Video::get_embed_URL($link)."?&autoplay=1&loop=1";

Video Class

class Video {
const _youtube_regex = '/(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/';
const _youtubeshort_regex = '/(\/\/.*?youtu\.be)\/([^\?]+)(.*)/i';
const _vimeo_regex = '/(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/';

 * Given filetype column from DB's article_medias table will return true if the media is video
 * @param string $source source from article_medias.filetype column
 * @return bool True if video
public static function is_video( $source ) {
	if ($source == 'youtube' || $source == '' || $source == 'vimeo') {
		return true;
	} else {
		return false;

 * Given a url param to a youtube or vimeo video, will return the related format
 * @param string $url Url to the video
 * @return bool|string
public static function get_source( $url ) {
	if (preg_match(self::_youtube_regex, $url)) {
		$format = 'youtube';
	} else if (preg_match(self::_youtubeshort_regex, $url)) {
		$format = '';
	} else if (preg_match(self::_vimeo_regex, $url)) {
		$format = 'vimeo';
	} else {
		return false;

	return $format;

 * Given a video url to either a youtube or vimeo video, will return the specific video id
 * @param string $url Video url
 * @return bool|string
public static function get_source_ID( $url ) {
	$format = self::get_source($url);

	switch ($format) {
		case 'vimeo':
			$vid_id = preg_replace(self::_vimeo_regex, '$2', $url);
			if (substr($vid_id, 0, 5) == "http:") { $vid_id = substr($vid_id, 5); }
			if (substr($vid_id, 0, 6) == "https:") { $vid_id = substr($vid_id, 6); }

		case 'youtube':
			$vid_id = rtrim(preg_replace(self::_youtube_regex, '$2', $url), '?');
			if (substr($vid_id, 0, 5) == "http:") { $vid_id = substr($vid_id, 5); }
			if (substr($vid_id, 0, 6) == "https:") { $vid_id = substr($vid_id, 6); }

		case '':
			$vid_id = rtrim(preg_replace(self::_youtubeshort_regex, '$2', $url), '?');
			if (substr($vid_id, 0, 5) == "http:") { $vid_id = substr($vid_id, 5); }
			if (substr($vid_id, 0, 6) == "https:") { $vid_id = substr($vid_id, 6); }

			return false;
	return $vid_id;

	* Gets the html url for the video
	* @param string $id Video id
	* @param string $format Video format/source
	* @return bool|string returns url for embedding the video
public static function get_embed_URL($url) {
	$format = self::get_source($url);
	$id = self::get_source_ID($url);

 switch ($format) {
	 case 'vimeo':
		 $link = ''.$id;

	 case 'youtube':
		 $link = ''.$id;

	 case '':
		 $link = ''.$id;

		 return false;

 return $link;