Title: SOLVED: TwentyTen Child theme PHP Warning block-patterns.php
Last modified: July 25, 2021

---

# SOLVED: TwentyTen Child theme PHP Warning block-patterns.php

 *  Resolved [dougjoseph](https://wordpress.org/support/users/dougjoseph/)
 * (@dougjoseph)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/)
 * Hello. I recently updated the WordPress core from 5.7.2 to 5.8, after backing
   up everything and after updating plugins and themes. This was on a multisite 
   network. One of the sites uses a Child Theme based on the TwentyTen theme. I 
   dutifully also ran the “update network” option. I instantly got the infamous 
   White Screen of Death on the one site in focus. When I finally located the PHP
   error log, the pertinent entries were along these lines:
 * `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`
 * I had the presence of mind to notice the key was likely “block-patterns.php” —
   however, when I googled using terms such as…
 * > TwentyTen Child theme PHP Warning block-patterns.php
 * …I got nothing related to speak of. I quickly sleuthed out that the issue was
   not in the child theme’s functions.php file, but rather in the parent theme’s
   functions.php file. Finally, I noticed it was calling for the existence of a 
   new code file, block-patterns.php, but it was calling for its existence inside
   the child theme, not just the parent theme!
 * I solved this by simply making a copy of the newly existing file, block-patterns.
   php, in the parent theme, and moving that copy into the child theme. Problem 
   solved. I hope this helps anyone else facing the same issue.
    -  This topic was modified 4 years, 10 months ago by [dougjoseph](https://wordpress.org/support/users/dougjoseph/).
    -  This topic was modified 4 years, 10 months ago by [James Huff](https://wordpress.org/support/users/macmanx/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [dougjoseph](https://wordpress.org/support/users/dougjoseph/)
 * (@dougjoseph)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/#post-14691542)
 * Reposting the last paragraph here, simply to be able to “reply and mark as resolved.”
 * > I solved this by simply making a copy of the newly existing file, block-patterns.
   > php, in the parent theme, and moving that copy into the child theme. Problem
   > solved. I hope this helps anyone else facing the same issue.
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/#post-14694590)
 * I suspect the developers will fix this eventually, so I recommend altering the
   file in the parent theme, /wp-content/themes/twentyten/functions.php by changing
   line 743 from this:
 *     ```
       require get_stylesheet_directory() . '/block-patterns.php';
       ```
   
 * to this:
 *     ```
       require get_template_directory() . '/block-patterns.php';
       ```
   
 * The function [get_template_directory()](https://developer.wordpress.org/reference/functions/get_template_directory/)
   will “[i]n the case a child theme is being used, the absolute path to the parent
   theme directory will be returned,” which will resolve the error for now, and 
   won’t leave you with a potentially outdated copy of block-patterns.php in your
   child theme folder.
 * Once the developers release a fix, the edited file will be overwritten, and you’ll
   be all good.
 *  Thread Starter [dougjoseph](https://wordpress.org/support/users/dougjoseph/)
 * (@dougjoseph)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/#post-14695877)
 * To all who were helped: I’m glad, and I also encourage taking note of the more“
   future proof” way of fixing it pointed out by [@linux4me2](https://wordpress.org/support/users/linux4me2/)…
 *  [zaneselvans](https://wordpress.org/support/users/zaneselvans/)
 * (@zaneselvans)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/#post-14695896)
 * It looks like this has been [fixed in the codebase](https://github.com/WordPress/wordpress-develop/commit/bedd023c3ae3e2d1d1594eca3184d4b719af02fa)
   as of earlier today.
    -  This reply was modified 4 years, 10 months ago by [zaneselvans](https://wordpress.org/support/users/zaneselvans/).
 *  Thread Starter [dougjoseph](https://wordpress.org/support/users/dougjoseph/)
 * (@dougjoseph)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/#post-14697767)
 * [@zaneselvans](https://wordpress.org/support/users/zaneselvans/)
 * > It looks like this has been fixed in the codebase as of earlier today.
 * Cool. Just out of curiosity, approximately how long does it usually take for 
   a fix to eventually be released in a new version of a theme?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘SOLVED: TwentyTen Child theme PHP Warning block-patterns.php’ is closed
to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/twentyten/4.6/screenshot.png)
 * Twenty Ten
 * [Support Threads](https://wordpress.org/support/theme/twentyten/)
 * [Active Topics](https://wordpress.org/support/theme/twentyten/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/twentyten/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/twentyten/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [dougjoseph](https://wordpress.org/support/users/dougjoseph/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/solved-twentyten-child-theme-php-warning-block-patterns-php/#post-14697767)
 * Status: resolved