Issue
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!
Solution
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. I'd be interested to know why this works, and the old one doesn't.
Answered By - cup_of
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.