You can queue a trusted CDN if you do not have the option to install it locally.
The following should be added to your functions.php if you have a standard WordPress architecture.
function enqueue_particlejs(){ wp_enqueue_script('particle-js','https://cdn.jsdelivr.net/npm/ particles.js@2.0.0 /particles.min.js'); } add_action('wp_enqueue_scripts', 'enqueue_particlejs');
Then you will need to use their way of actually launching on the page, which means assigning a particle-js identifier to one of your dom elements.
<div id="particle-js"></div>
If you don't have access to javascript files, you can get away with this:
<script> particlesJS.load('particle-js', '<?= get_template_directory_uri() . '/assets/particlejs.json' ?>', function() { }); </script>
You will need to create the filejs.json file somewhere in your WordPress directory and link to it above.
They give one example or simply export it from the site you are linking to.
Mel macaluso
source share