How To Add Javascript To WordPress




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:

add_action()

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”

  1. 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

  2. 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

  3. Hi, the following SCRIPT is BLOCKED when I check google console. Do you know how htt​p:/​/pa​gea​d2.​goo​gle​syn​dic​ati​on.​com​/pa​gea​d/j​s/a​dsb​ygo​ogl​e.j​s error can be fixed please?

Leave a Reply