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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)