• Resolved csjWP

    (@csjwp)


    Hi I’m trying to get featherlight setup as the default lightbox, right now visual composer is using prettyPhoto. So I need to overwrite it.

    I asked wpbakery and i got this response.

    Hello, you can actually overwrite prettyphoto by adding prettyPhoto() in your functions.php and call another lightbox.

    But I don’t know what to write to call featherlight in this manner.
    Any help would really be appreciated.

    Thanks.

    https://www.ads-software.com/plugins/wp-featherlight/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Robert Neu

    (@fatmedia)

    Hi,

    Once prettyPhoto has been disabled, you shouldn’t need to do anything else to lightbox images on the site. If you’re looking to lightbox other content, you’d need to add data attributes to the things that you want to lightbox.

    The full listing of data attributes can be found on their GitHub documentation and here’s an example of lightboxing a video on one of our theme demos.

    Hope that helps!

    Thread Starter csjWP

    (@csjwp)

    Hi again,
    I’ve added this to my Child Theme functions.php file

    function remove_scripts(){
    wp_enqueue_script('prettyphoto' );
    wp_deregister_script('prettyphoto' );
    }
    
    add_action( 'wp_enqueue_scripts', 'remove_scripts', 100 );

    And it do disable prettyPhoto from loading. But I’m afraid WP Featherlight isn’t taking over. I just see “large image”.

    Is it possible to create a funtion that just calls WP Featherlight where prettyPhoto would normally get called?

    Interested too…

    Plugin Author Robert Neu

    (@fatmedia)

    Can either of you provide a link to a site where prettyPhoto has been disabled and WP Featherlight is activated but not working? If I can see what the actual issue is I may be able to offer more insight.

    If not, the only way I can debug is to test using a copy of Visual Composer on a local site, which I can definitely try but it may take me a while to get to it.

    Thread Starter csjWP

    (@csjwp)

    Hey Robert, thanks for the reach out and your willingness to assist with this. The site I’m working on I’m afraid is running locally on MAMP. So I don’t have an easy way to share it with you… Unless there are options and tricks i don’t know about. If you want me to do something, please reach out.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Help Overwrite prettyPhoto in functions.php’ is closed to new replies.