Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #833583

    Hello,

    I found a few threads that are related but none has solved my problem. I am trying to remove the modal lightbox on a single page that has a plugin which uses its own lightbox. Basically two light boxes appear, but I only need one. The page I’m referring to is below.

    Here is the code I am using.

    In my child avia.js I changes a line to:
    exclude : '.page-id-14154 .noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"]',

    then I added this to my child theme functions.php

    function wp_change_aviajs() {
       wp_dequeue_script( 'avia-default' );
       wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true );
    }
    add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );

    It is still not working. Could you please tell me where my error is?

    Thanks

    #833625

    I referred to an earlier post but it still doesn’t seem to be working. I’ve tried adding a class and using the page id. Here is the code I currently have added to the avia.js in my child theme.

    exclude : '.postid-14154, .content-timeline, .noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"]',

    #835360

    Hi,

    Sorry for the late reply!
    Please change the code to following one

    
    exclude			:	'.page-id-14154, .page-id-14154 a, .noLightbox, .noLightbox a, .fakeLightbox, .lightbox-added, a[href*="dropbox.com"]',

    Best regards,
    Yigit

    #925449

    An easier, no need for file changes, way (for me) was:
    On the page with the plugin shortcode add a div

    <div class="noLightbox noLightbox a fakeLightbox lightbox-added">
    [shortcode from plugin]
    </div>
    #925512

    Hi,


    @mikehenze
    Thanks for sharing your solution! Truly appreciated :)

    Best regards,
    Yigit

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Disable modal lightbox on single page’ is closed to new replies.