WordPress.org

Forums

[resolved] Pb with ajax requests and multiple theme (10 posts)

  1. Willy Bahuaud
    Member
    Posted 2 years ago #

    I've a very strange bug on an installation with 2 websites:

    When I do an ajax request to admin-ajax.php from the root theme, the function used for the response is located in the other one...

    I don't understand why ?? How can I solve this ?

    Can admin-ajax.php detect the refering theme ?

  2. bwebblog
    Member
    Posted 2 years ago #

    So Willy, I think that you can try to disconnect one of them ...

  3. Willy Bahuaud
    Member
    Posted 2 years ago #

    Yes, I just tried. I disconnected the two sites, this does not change ...

  4. Are you using Multisite or is this just a multiple theme question?

  5. Willy Bahuaud
    Member
    Posted 2 years ago #

    Yes, it's a multisite installation, with 2 website (which use different themes) inside.

  6. lpointet
    Member
    Posted 2 years ago #

    Hi Willy,
    Some questions for you:
    Can you tell us which WP version it is?
    Are your themes custom ones or did you buy them somewhere? What are those themes?
    I suppose your Ajax requests work well in the admin area? (for example, approve a comment)
    Do you know the params sent with your request?

  7. Willy Bahuaud
    Member
    Posted 2 years ago #

    I use the 3.3.1 version and I use 2 custom theme quite similar. I don't know because I don't use ajax requests in admin area...

    In the request parameters : "action" => Name of my function (sendformparcours) and others serialized values obtain by the form.

    I use ajax type POST, with jQuery.

  8. Willy Bahuaud
    Member
    Posted 2 years ago #

    It seem admin-ajax load the wrong function file... ,maybe because it doesn't know wich "functions.php" it have to load. Can I force it to use one of the theme ?

  9. Willy Bahuaud
    Member
    Posted 2 years ago #

    I got another ajax request which work perfectly on the right theme...

    This makes me think that the application does not work is performed on a site page loaded in an iframe.

    Is this an important detail?

  10. Willy Bahuaud
    Member
    Posted 2 years ago #

    I solved it, but I dont know how... ^^

Topic Closed

This topic has been closed to new replies.

About this Topic