After
wp_head()
,
global $wp_scripts
,
$wp_scripts
contains all handles of enqueued scripts but URLs. So how can I get all URLs of enqueued scripts?
After
wp_head()
,
global $wp_scripts
,
$wp_scripts
contains all handles of enqueued scripts but URLs. So how can I get all URLs of enqueued scripts?
You must be logged in to post a comment.
Here’s the codex page for WordPress on how to enqueue scripts and styles. It’s pretty straight forward. If I were to further explain it, I’d basically be copying and pasting. If you’re still stuck please tell what you’re trying to do, or have tried, and why it’s not working.
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Well it would have been better if you would have explained your purpose behind doing so.
I am assuming that you just want to check whether your JS file is getting enqueued or not.
For that purpose I would suggest a much simpler solution which would be benificial and effective for all of your future references too.
If you really want to check the URLs of all enqueued JS files, I would suggest you to install an addon FireBug for your FireFox browser.
After you have installed it, just press F12 or right click on any part of page and select “Inspect with FireBug”.
Now a small panel opens up in the bottom of the screen.
Click on “Net” Tab. & Then select “Javascript” in the subordinate tab.
Here you will get list of all of the JS files that have been enqueued by your theme & plugins.
If the JS file didn’t get loaded, then it will show a “404 Not found” next to the name of your JS file.
So you can easily check whether your JS file got enqueued or not.
If you check the screenshot, you see that you get all the JS files under 1 tab with all the information like ‘URL, Size, Remote-ip & Time Line’.
So I guess this will solve your problem.
In case it still doesn’t or you are trying to achieve something else, please do reply & give some more details about it.