Adding custom js into the head

Hi there !
Any hint for me how or where to add some to the whole page to implement for example smooth anchor scrolling ?

Thanx in advance, Daniel

Thanks @danielbartel - you can add it in the settings of Admin > custom JS. Just paste it in there and it will appear on every page (as opposed to pasting it in the META drawer of the page which will just add it to that single page)

But you may as well add it to the template files.

Add the JS file to the Template folder then link to it in the layout.php with a reference like:

`<script src="<?php echo $path; ?>/template/js/my-js.js"></script>`

Hope that helps! :slight_smile:

1 Like

Sure that helped ! Thanx very much!

1 Like