Hello,
I have added some custom JS via functions.php in my child theme to include scrollreveal.js
For some reason, it’s only loading when logged in which is weird. I have checked the source code & the script is still there, but not working.
I have tried global custom JS, then adding the following HTML to the head & body in the functions.php.
// //Head tags
// =============================================================================
add_action('wp_head','my_tracking');
function my_tracking () { ?>
<link rel="stylesheet" href="https://i.icomoon.io/public/08d3182f10/WebRollicons/style.css">
<script type='text/javascript' src="/wp-content/themes/webrollchild/js/ScrollTrigger.min.js"></script>
<script>document.addEventListener('DOMContentLoaded', function() {
var trigger = new ScrollTrigger({
toggle: {
visible: 'visfade',
hidden: 'invisfade'
},
offset: {
x: 0,
y: 250
}
});
});
</script>
Is there something blocking it? The site is newversion.webandroll.co.uk. Don’t worry, I have tried disabling any potentially conflict plugins, & I don’t need to contact a custom developer, I just need to know how to add the above code in so it works outside of being logged in.
Thanks!