0

Ok, i am VERY new to wordpress (2 Hours new). I am creating a page template, which works fine, but this is the issue i am having:

In the template.php file, i have this code:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
    function loadTweets() {$.getJSON("http://mysite.com/wp-content/themes/truemag/page-templates/includes/twitter.php", function (json) {alert(json);});} setInterval(loadTweets(), 60000);
</script>

For some reason when i go to the URL in my browser, I get an Error 500. Same with my ajax call? How would i fix this?

I was told maybe a .htaccess file, but i dont think that would be an issue. For some reason this page is blocked.

1
  1. You shouldn't be including jQuery explicitly. WP ships with a copy and multiple copies tend to mess things up. See wp_enqueue_script().

  2. You shouldn't be trying to load PHP file inside a theme directly. It won't load WordPress environment that way (unless it tries to do so explicitly, which is usually very fragile and pretty much cannot be reliably done in public code).

  3. Error 500 is unfortunately very not transparent thing. It is produced by your web server rather than WordPress and there is no insight into what might be causing it that can be gained on WP level. You'll have to look up details for error in your web server logs / ask hosting support to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.