Dynamically add Js

Question

I have a basic bunch of CSS/Js files defined in my functions.php file. There I register and enqueue those scripts and stylesheets.

But in specific situations I want to load additional scripts based on the site template which is used.

I tried to register and enqueue those additional scripts in the specific Template file, but it didnt work. It does only work when included in the functions.php.

What is the correct way to do this?

0
blixary 2 months 2022-05-07T09:37:02-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse