Fatal error when cloning and installing the cloned theme
-
This is actually from Bard. I will add my comment at the end
When attempting to clone a WordPress theme using the new “Create Block Theme” tool, you may encounter the error message:
“Warning: require_once(/home/user/Local Sites/dummy-site/app/public/wp-content/themes/dummy-theme/inc/class-dummy-theme-update.php): Failed to open stream: No such file or directory in /home/user/Local Sites/dummy-site/app/public/wp-content/themes/dummy-theme/functions.php on line 71
Fatal error: Uncaught Error: Failed opening required ‘/home/user/Local Sites/dummy-site/app/public/wp-content/themes/dummy-theme/inc/class-dummy-theme-update.php’ (include_path=’.:/usr/share/php:/www/wp-content/pear’) in /home/user/Local Sites/dummy-site/app/public/wp-content/themes/dummy-theme/functions.php:71 Stack trace: #0 /home/user/Local Sites/dummy-site/app/public/wp-settings.php(611): include() #1 /home/user/Local Sites/dummy-site/app/public/wp-config.php(96): require_once(‘/home/user/Loc…’) #2 /home/user/Local Sites/dummy-site/app/public/wp-load.php(50): require_once(‘/home/user/Loc…’) #3 /home/user/Local Sites/dummy-site/app/public/wp-admin/admin.php(34): require_once(‘/home/user/Loc…’) #4 /home/user/Local Sites/dummy-site/app/public/wp-admin/themes.php(10): require_once(‘/home/user/Loc…’) {main} thrown in /home/user/Local Sites/dummy-site/app/public/wp-content/themes/dummy-theme/functions.php on line 71″
This error indicates that the file <code class=””>class-dummy-theme-update.php is missing from the theme’s directory. This file contains important functionality for the theme, and its absence is causing the error.
To fix this issue, you can follow these steps:
- Check the Original Theme: Verify if the <code class=””>class-dummy-theme-update.php file exists in the original theme. If it does, copy it to the cloned theme’s <code class=””>inc directory.
- Create the Missing File: If the file is not present in the original theme, create it manually and copy the contents from the original theme’s <code class=””>functions.php file into the new file.
- Ensure Correct Filename: Rename the newly created file to <code class=””>class-dummy-theme-update.php.
- Save and Retry: Save the file and attempt to create the block theme again.
After following these steps, you should be able to successfully create the block theme without encountering the error message.
My comment:
I deleted the functions.php file after I copied its content. I added this content to a new php file called class-dummy-theme-update.php and everything is working now. Two things need to be mentioned:
- You lose all the patterns that came with the original theme.
- To “Create Block Theme” team. Please do something about this issue. The cloning feature is not smooth and it seems that it depends on the theme. Perhaps a fix or may be a warning when using this feature?
Thank you!
- The topic ‘Fatal error when cloning and installing the cloned theme’ is closed to new replies.