Lỗi themes themevn4u-wp-2023 vn4u-option admin update.php on line 4 năm 2024

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:

  1. 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.
  2. 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.
  3. Ensure Correct Filename: Rename the newly created file to <code class=””>class-dummy-theme-update.php.
  4. 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: