Custom php script

Hay, how i can add custom script to be loaded every time someone visits the site, i tried in intex.php but it gives few errors?

What exactly are you trying to achieve?

Well am trying to add scrip that display every request on the site their ip etc

You could use the default controller for that – I guess …

The problem with the default controller is that it is overwritten by specific template controllers. You could insert your script into your header or another snippet that is called on every page. Or provide the functionality as a plugin that you can call wherever you need it.

https://github.com/jenstornell/kirby-init-controller

This is an extra controller that will run before the template starts.

I use it all the time.

1 Like