• Hello,

    I would like to know if there was a simple custom js I could add to a theme to force it to use lightbox with PhotoSwipe instead of its own.

    The theme is nice but totally locked and the lightbox is a shame.

    Thank you in advance for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    Unfortunately this is not that easy.

    It depends how a theme adds it’s own ligthbox. In general there needs to be a click event listener which will be added to every image link by the theme, so its own lightbox will be used whenever you click an image link. But there is no way to remove such listeners – because for this, the code would need the listener handles created by addEventListener() which it does not have.

    A better approach would be to ask the maintainer of the theme if there is a way to disable the integrated lightbox or to create a child theme with to remove the lightbox specific stuff (for example remove the queued frontend script for the theme lightbox).

    Can you tell me what theme you talk about?

    Thread Starter fabricegasser

    (@fabricegasser)

    Thank you for your quick answer, the theme is Kamera: https://kamera13.qodeinteractive.com/?_ga=2.219215641.1433571230.1686478034-69804937.1686478034

    and here is the site I’m working on: https://paulgodefroy.liliroze.com/

    Plugin Author Arno Welzel

    (@awelzel)

    I see. Since the theme is a commercial solution which is not for free I recommend to ask the support of Quode Interactive how to disable the lightbox in the theme gallery.

    Thread Starter fabricegasser

    (@fabricegasser)

    I can disable the lightbox myself in the settings, but once it’s disabled I don’t know how to activate lightbox with PhotoSwipe in the theme, that’s where a custom js would help ??

    Plugin Author Arno Welzel

    (@awelzel)

    There is no custom js needed, Lightbox with PhotoSwipe will work automatically. If not then there is something wrong with your website.

    Edit: or the theme blocks event handlers on purpose – in this case you should also contact the support, since I can not help you with this.

    • This reply was modified 1 year, 4 months ago by Arno Welzel.
    Thread Starter fabricegasser

    (@fabricegasser)

    Perfect, thank you very much for your help.

    best regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘custom js to replace a theme lightbox by lightbox with PhotoSwipe’ is closed to new replies.