• Resolved enngins

    (@eugene99shum)


    I have a unpleasant situation. I use Elementor Plugin on my wordpress site.

    The theme was made with Jquery version v3.2.1. All actions are related to this version. So, I include this in footer.

    So.. I did not known that wordpress use his own Jquery that’s loaded from wp-includes. There’s version 1.12.4. It’s included in header.

    Problem is in compatibility with elementor galery lightbox. You can see it here: https://selectrent.md/catalog/mobila/. In Chrome, the lightbox doesn’t working. I mean the arrows. I tested in Firefox and Chrome mobile – all it’s ok. But on Chrome Desktop doesn’t working.

    If I remove my Jquery, lightbox works. But all my actions doesn’t.

    So.. can you provide me a solution to solve this problem without remade my theme?

    Thanks in advance!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter enngins

    (@eugene99shum)

    So, I found a temporary solution. I just deregister my jquery on the pages with lightboxes. I’m lucky there’s no need for that.

    Deregistering is with function file, based on template type of pages. Maybe someone will need the code.. just paste it into the end of your enqueue scripts function:

       // Deregister custom JQuery on product pages
        if(is_page()){ //Check if we are viewing a page
            global $wp_query;
    
            //Check which template is assigned to current page we are looking at
            $template_name = get_post_meta( $wp_query->post->ID, '_wp_page_template', true );
            if($template_name == 'YOUR TEMPLATE NAME'){
                //If page is using lightbox we desable our jquery.
                wp_deregister_script( 'SHORT OF YOUR SCRIPT' );
            }
        }
    

    But the question remain open… It’s just a temporary solution and I hope there’s an more correct way to solve this issue.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Lightbox Issue + Jquery conflict’ is closed to new replies.