file_get_contents(includes_url('/ js / jquery / jquery.js')); 不工作

Hello I want to get the contents from the local jquery path in my wordpress theme. I am doing the following code:

$jq = file_get_contents(includes_url( '/js/jquery/jquery.js' ));

when I echo out the variable jq there is nothing stored in it

echo $mergedJs; // nothing

This only happens when I upload the theme to the server,it works fine on my local which is odd.

Any suggestions?

Thanks!

i figured it out, i had to change

$jq = file_get_contents(includes_url( '/js/jquery/jquery.js' ));

to

$jq = file_get_contents(ABSPATH . WPINC . '/js/jquery/jquery.js');

and it worked. can anyone explain why this works and the old one doesnt?

thanks!