Twenty Ten, Twenty Eleven, and Twenty Twelve Update Fixes Fatal Error

If you’re using the Twenty Ten, Twenty Eleven, or Twenty Twelve themes, you’ll want to update them as soon as possible. A few days ago, a user by the name of dougjoseph created a support thread for the Twenty Ten theme. After updating a multi-site network from WordPress 5.7.2 to 5.8, he encountered the White Screen of Death also known as a fatal error.

After reviewing the error logs, he narrowed it down to an issue with the theme calling for block-patterns.php. Doug solved the issue by creating a block-patterns.php file and placing it in his child theme.

PHP Warning: require( ~ /public_html/ ~ /wp-content/themes/ ~ child-theme/block-patterns.php): failed to open stream: No such file or directory in / ~ /public_html/ ~ /wp-content/themes/twentyten/functions.php on line 743

A user by the name of linux4me2 responded to the forum thread with a more permanent solution. His solution required changing a line of code within Twenty Ten’s functions.php file.

Before:


require get_stylesheet_directory() . '/block-patterns.php';

After:


require get_template_directory() . '/block-patterns.php';

As you can see from this change on GitHub, the correct path has been added to Twenty Ten to avoid creating a fatal error. This change is also present in the codebases of Twenty Eleven and Twenty Twelve. Each theme has been updated and is available from the WordPress theme directory.

Hat tip to Deborah Edwards-Oñoro.

Leave a Comment