0
I have an application that uses wordpress and I need to add a javascript in it, I saw several videos and posts on the internet and I understood just do this:
<?php
wp_register_script("meuscript", "js/meuscript.js");
function my_scripts_loader() {
wp_enqueue_script("meuscript", "js/meuscript.js");
}
add_action("wp_enqueue_scripts", "my_scripts_loader");
?>
But I don’t know where to add this code I got a little confused, I saw something about adding to the theme or something
It’s the simplest way, I prefer it that way too, you just have to be careful if you’re changing the subject.
– Darlei Fernando Zillmer
Yes, I found it easier that way.
– Luiz Felipe Nalin Borges
This way of doing it is not "wrong"?
– Costamilam
@Guilhermecostamilam if it worked ta right hehehe So as I said do not understand much of wordpress I believe that has somewhere to put that is more suitable not to give dick when changing theme.
– Luiz Felipe Nalin Borges