I have found a problem with a fatal error in the theme for mobile when WordPress is updated to version 6.4 or higher.
It seems that when a mobile theme is selected, the desktop theme is also loaded first, causing the error due to the absence of files or the inability to redefine scripts.
I have worked around it by downgrading WordPress to 6.3, but it has not been a radical solution.
I just checked our plugin with WordPress 6.4.1. and couldn’t find any fatal error at all. And the theme switching is working fine here. Tested with default wordpress theme.
Can you send me the error messaging you are getting ?
Just an assumption, but I think whoever has an error after the latest version of wordpress is the “can not redeclare function” error(same with @Kaz). I am also having the same problem and rolled back my wp version to 6.3.2 to fix it temporarily. Please fix!
On the smartphone version this error pops up. PC version is fine (probably due to loading algorithm)
Error message:
‘Fatal error: Cannot redelcare “sample_function_a()” previously declared in “/path/to/theme_1/functions.php” in “/path/to/theme_2/functions.php” on line xxx
Wrote a wall of text including a fix over at https://wordpress.org/support/topic/wordpress-6-4-the-plugin-no-longer-works/ . Basically, if one of the functions get_template_directory() or get_stylesheet_directory() BEFORE the plugins_loaded hook messes up the correct functioning of Any Mobile theme switcher. In my case, it was the Plugin Meta Box that was the culprit, but it could be any plugin that doesn’t wait until the plugins_loaded hook to call these functions.
Author
Posts
Viewing 7 posts - 1 through 7 (of 7 total)
The topic ‘mobile theme error with WP 6.4 or higher’ is closed to new replies.