Timeline for How to add JavaScript file using wp_enqueue_scripts?
Current License: CC BY-SA 3.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 28, 2020 at 16:24 | comment | added | WordPress Speed | @Alex Was my answer helpful to you?! Please accept and upvote if it was helpful | |
May 19, 2016 at 14:02 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
S Dec 25, 2015 at 5:59 | history | edited | Gabriel | CC BY-SA 3.0 |
deleted 119 characters in body; edited title
|
S Dec 25, 2015 at 5:59 | history | suggested | WordPress Speed | CC BY-SA 3.0 |
Title refined to convey the question goal,also added one tag
|
Dec 25, 2015 at 5:28 | review | Suggested edits | |||
S Dec 25, 2015 at 5:59 | |||||
Dec 22, 2015 at 1:44 | review | Suggested edits | |||
Dec 22, 2015 at 1:50 | |||||
Dec 22, 2015 at 1:42 | answer | added | WordPress Speed | timeline score: 1 | |
Nov 18, 2015 at 10:20 | comment | added | WPTC-Troop |
First of all, Please check whether your file.js and custom script are inserted in your page by viewing the page source.
|
|
Feb 9, 2015 at 15:42 | comment | added | Alex | Yes, i does the wp_head() in the header.php | |
Feb 9, 2015 at 15:11 | comment | added | user47133 | Do you have wp_head() in your header.php file? | |
S Feb 9, 2015 at 13:45 | history | suggested | Ferrmolina | CC BY-SA 3.0 |
Improved Formatting
|
Feb 9, 2015 at 13:30 | review | Close votes | |||
Feb 11, 2015 at 6:38 | |||||
Feb 9, 2015 at 13:22 | review | Suggested edits | |||
S Feb 9, 2015 at 13:45 | |||||
Feb 9, 2015 at 13:16 | history | edited | Alex | CC BY-SA 3.0 |
added 261 characters in body
|
Feb 9, 2015 at 13:15 | comment | added | Alex | If will edit, but I use the code posted below: add_action('wp_enqueue_scripts', 'my_enqueue_front_scripts'); function my_enqueue_front_scripts(){ wp_enqueue_script('my-custom-scripts', get_stylesheet_directory_uri().'/js/file.js'); } | |
Feb 9, 2015 at 13:13 | comment | added | Brad Dalton | possible duplicate of I want to enqueue a .js file to my child theme | |
Feb 9, 2015 at 13:12 | comment | added | Brad Dalton | Please post the code you are using to load your script as an EDIT to your question. | |
Feb 9, 2015 at 12:45 | history | edited | Alex | CC BY-SA 3.0 |
added 108 characters in body
|
Feb 9, 2015 at 12:08 | answer | added | David Gard | timeline score: 1 | |
Feb 9, 2015 at 12:04 | comment | added | David Gard |
How are you calling to script? Specifically, are you declaring it directly in header.php (the wrong way) or using the wp_enqueue_scripts hook and adding it via a function? Please update your question to include more details.
|
|
Feb 9, 2015 at 11:26 | history | asked | Alex | CC BY-SA 3.0 |