![]() |
|
Javascript integration - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Themes (https://forum.zenphoto.org/forum-5.html) +--- Thread: Javascript integration (/thread-14101.html) |
Javascript integration - Roland - 16-04-2026 Hello ! I notice that the plugin's javascript is systematically integrated from the home page. Never on demand. Which is a good thing for me. Do you confirm? Thanks for your help ! Javascript integration - acrylian - 16-04-2026 Generally it is up to you how and where you include what. You can or have to include js on any theme page where it is needed. Generally it is a good idea to have a global inc-header.php/header.php file that is included on every theme page to load js/css files so you don't have to do it individually. I don't remember how you do it in Collections. Also a good idea is to use the "theme_head" filter to include js/css . Especially if you want to override styles that plugins serve you need to make sure your theme styles load as the last. (the recommend way how to load js/css that might/will probably change in the future but that is in the futureā¦) Javascript integration - acrylian - 16-04-2026 As I never heard of swup.js before I took a look. Sounds interesting. |