There are some real challenges about using Multiple Themes with Ajax requests. Even Jon (the author of the plugin) struggled with this. I’m guessing that perhaps you might need to rely on something other than the Ajax request to choose your theme (although I’m just guessing).
It is possible Multiple Themes can’t handle this, but it’s going to require a lot of experimenting.
Good luck!
–David
I (the “Jon” that David mentions above) just took a look at the code and the plugin’s AJAX-handling code is not being executed in any /wp-admin/ URLs because of a check of the is_admin() function.
My mind is a little foggy on what happened as I was fully occupied with two older relatives with huge medical issues. My best recollection is that the AJAX code was written and fully tested a long time earlier, then, much later, other issues came up that saw me have to rewrite the beginning of the plugin, and I more or less blindly coded the usual if ( is_admin() ) logic that is used in almost all plugins.
When I decided to adopt out my plugins, I felt that I had to release the features I had been working on and thought I had completed. With so little time to spend on it, my testing was not comprehensive.
Hi David and Jon,
Thanks for the fast replies. My solution to this was the following. (This has nothing todo with my first post problem. That was just a examples of the problem.)
In my current situation I have some functionality in plugins instead of themes. And they do some DB things and then return a view. I don’t want this view in my plugin anymore because I think it’s smarter to have view related things in my theme instead.
So when I do a ajax request to one of my plugins I will send a theme param that lets the plugin know what theme I’m currently on. Then I can load the correct template files in the new theme. But went I have loaded these views I can’t work with my themes new functions thats located in wp-content/themes/newtheme/app/bootstrap.php. So I do a require_once on that and now I have all functionality I need.
Hope you guys understood! This solved my issues atleast.
Require_once can be a lifesaver. Glad it’s working for you (and thanks, Jon!).
–David
P.S. Marking as resolved because it is.