• Resolved alexiumz

    (@alexiumz)


    Hi,

    I have a link to my Vimeo channel in the main menu on my website and unfortunately when clicked, opens an empty lightbox.

    I believe this is caused by the autodetect, however I need to enable this as it isn’t possible to manually specify the class for other links elsewhere on my site where I need the lightbox.

    I have tried specifying ‘nolightbox’ as the class in the menu options from within the WordPress dashboard, however inspecting the source it appears the autodetect is triggered after the ‘nolightbox’, overriding it:

    <li class="nolightbox menu-item menu-item-type-custom menu-item-object-custom menu-item-4314 depth-0"><a target="_blank" href="https://vimeo.com/wildfilmsltd" class="link link-depth-0 fancybox-vimeo"><span><i class="fa fa-vimeo" aria-hidden="false"></i></span></a></li>

    Is there any other solution to disabling the lightbox popup, either on the individual link or on the menu as a whole?

    Thanks in advance.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, yes you are right this can be improved. It will be adressed in the next release but for now, you can do two things:

    Either disable Vimeo autodetection and add the “fancybox-vimeo” class to all links that you do want to show in the lightbox.

    Or add this little script snippet in a html widget or in the theme footer.php before the line with <?php wp_footer(); ?> :

    
    <script type="text/javascript">
    jQuery(document).on('ready', function(){
      jQuery('li.nolightbox a').addClass('nolightbox');
    });
    </script>
    

    (note this will only work of jQuery is loaded in the header, not moved to the footer by another plugin for example)

    Thread Starter alexiumz

    (@alexiumz)

    Super. Got it working, thanks very much.

    For those who might stumble upon this thread in the future, don’t forget to include ‘nolightbox’ in the menu CSS class too – (I forgot at first and thought it didn’t work!)

    You might need to clear the cache on your server too to update all the pages – mine was working/not working on different pages on different devices until I did this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable autodetect in menu’ is closed to new replies.