Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7676021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:06:13+00:00 2026-05-31T17:06:13+00:00

I have an ajax.php file in my WordPress themes folder, and this was working

  • 0

I have an ajax.php file in my WordPress themes folder, and this was working fine on the DEV server. However, when I moved it to another server, the script that I have written no longer works… bizarre!

Im now rolling back to try and find the problem, but its most annoying because the very same version works on another server?!

Here’s the code (for what its worth…)

Javascript Call:

   function change_event(ID){
     //alert("ID: "+ID);   
     $.post('wp-content/themes/muni/ajaxcalls.php', 
     { id: ID }, 
     function(data){
       alert('complete: '+data);
       //$('#showingevent').html(data);
     });     
   }

ajaxcalls.php

require_once("../../../wp-blog-header.php");  
global $more; 

At this point, it breaks. There is no point including the code I have written after the require. If I comment this line, the code below works.

If I browse directly to the ajaxcalls.php file, I get the results I am expecting, but it will not feed back to the success function of the ajax call.

Any help would be greatly appreciated

Cheers SO!

Tom

edit: I’m firing change_event using this:

   $('.eventoption A').click(function(ev){
     ev.preventDefault();
     change_event($(this).attr('id'));
     clearInterval(timer);
   });

I’ve also updated the change_event() function to reflect the one that I’m using rather than the debug that I was using before.

The problem happens as soon as I include the wp-blog-header.php file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:06:14+00:00Added an answer on May 31, 2026 at 5:06 pm

    The trick was to include wp-load.php instead of wp-blog-header.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that works well: {livre:empty_name} $.ajax({ url: sent.php, type: post, dataType:
I have been working on on an AJAX chat application using php, mysql. It's
Within my index.php file I have an AJAX function that will call a function
I have the following PHP script being called by AJAX: <?php // file /ajax/loopback.php
I am having problems with jQuery Ajax and PHP I have my php file
I have written jQuery code, in files Main.html and ajax.php . The ajax.php file
I have a file ajax.php that needs to trigger a big while loop and
I have an ajax request sending some data to a php file: Ext.Ajax.request({ url:
I have a page called example1.php . This page calls another page with some
i have one AJAX function getting results from php file as bellow $.ajax({ type:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.