I'm trying to use GLide.js
and after installing it with npm, i'm trying to access it using script src
This is the code i'm using
<script src="<?php echo ABSPATH.'/node_modules/@glidejs/glide/dist/glide.min.js';?>"></script>
I know wordpress has specific methods to acess folder for example:
<script src="<?php bloginfo('template_url'); ?>/js/navbar.js"></script>
but since node modules is in root , i'm guessing there's another one
Thanks in advance!
ABSPATH
is a directory path not an URL, usesite_url()
orhome_url()
instead.<script src="<?php echo site_url('/node_modules/@glidejs/glide/dist/glide.min.js'); ?>"></script>