One of the reasons you might want to replace Visual Composer lightbox (it is using prettyPhoto actually) is because of the mobile view where images opened using the effect are so small that you can hardly see or scroll through them.
Several people have asked about this on official Visual Composer website, but they only gave short answers which may be difficult to grasp for whoever isn’t a programmer. In short, this is how you do it – please note that this works for versions up to 4.x.x so if this is not working for versions 5.x.x (version 5 is not yet released as of this writing, nor there are any special information about it, but just to be on the safe side), feel free to post in the comments so I could remove this article. But until then, I hope some of you will find it useful.
So this is how it goes:
First, you’ll want to put the following code into functions.php of your parent or child theme:
1 2 3 4 5 6 |
function remove_vc_scripts(){ wp_enqueue_script('prettyphoto' ); wp_deregister_script('prettyphoto' ); } add_action( 'wp_enqueue_scripts', 'remove_vc_scripts', 100 ); |
After you have done it, prettyPhoto is disabled. Now it’s time to pick another lightbox and this is one of the solutions I definitely recommend – Responsive Lightbox by dFactory. But given that VC adds rel=”prettyPhoto” attribute, you’ll want to set the new lightbox like this, making sure that you name the correct Selector:
That’s it!