getJSON on WordPress Page

Turns out the issue was not with WordPress but with the PHP Configuration. allow_url_fopen was set to off on the server, whereas on the localhost it was on. When I updated that, the script worked fine. Thank you.