In this video I will show you how you can add you own Javascript file to WordPress. I love Javascript!!
wp_enqueue_script code reference:
Javascript: https://developer.mozilla.org/en-US/docs/Web/JavaScript
jQuery: https://jquery.com/
If you have questions please leave a comment below.
Twitter: https://twitter.com/ieatwebsites
Linkedin: https://www.linkedin.com/in/joseluisfremaint
instagram: https://www.instagram.com/ieatwebs/
Facebook: https://www.facebook.com/Ieatwebsites/
Music by PeriTune – Coffee Lounge
Original source
31 responses to “How To Add Javascript To WordPress”
Hi, nice tutorial, I am kind of new in this, I did everything you said but nothing happen. Silly question: do I have to add any jQuery file to my wordpress?
Thank you for your help, this has assisted me greatly.
how should I do if I want to add js to just specific one page? I think your code will add javascript file to all my wordpress pages but I want to add my javascript file just on a specific wordpress page
It works well for me. Your video saved my life in the company. Thank you so much for the excellent explanation.
a basic problem i had was when i used the get_stylesheet_directory_uri, it came up with an abort and said it was trying to go through the themes style.css file instead of going straight into the JS folder, if you have this problem use get_template_directory_uri instead, probably a better idea to beguin with, not sure why ude use a style directory for a js file
That’s awesome, thanks!
Thanks!
Thank you J!!!!! I'm a newbie and was up until 3 trying to figure my crap website and your solution solved my problem!!
Basic question: if I know how to JavaScript, why do I need the basic WP theme at all? Wouldn't it make more sense for me to code the website from scratch? This is something I'm not getting…
Enjoy your tuts… woowwwww….thanks
Thanks for this tutorial !
loved it
Hi, the following SCRIPT is BLOCKED when I check google console. Do you know how http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js error can be fixed please?
could somebody help!! it fades for less than a second then it shows again. it does not completely come off
hi my fadetoggle does not work. i works partially. the class hides for less than a sec then shows
posta o código para download por favor
Cool stuff.
Really well done! Thank you.
My jquery is properly enqueued, but when I use class tags in my html they're unaffected by the jquery function.
Hi! I followed your tutorial but when I refreshed the page it became blank, I'm sure the syntax is correct, any idea?
Thank you!!!!
Tysm man!
How to call jQuery library to functions.php
Hey, it worked! 😀 Thanks for your supertutorial!
heey but what happen when you update the theme? than every thing is gone right?
thanks a lot bro ur great man merci gracias chokran
How did you get your WordPress files in a script editor?
Realy good job.
Can you say me how i can add a java banner in my contribution?!
Thanks for help
good job!!
sweet mate
wooow that is awesome