Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Make a Website with WordPress Customizing WordPress Themes How to Make Child Themes

Nathalie van Wijkvliet
Nathalie van Wijkvliet
4,819 Points

More files to upload for Child theme?

Hi everyone,

I have been trying to make a childtheme by following the instructions from the video. However, after doing so, I could not login to my site anymore. In the PHP error log appeared the following message:

PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/wittebeertje/www/wp-content/themes/nextchild/admin/meta-box/meta-box.php' (include_path='.:/usr/local/php-2.2.26_5.3.28_2/lib/php') in /home/wittebeertje/www/wp-content/themes/next/functions.php on line 29

I contacted my webhost, they said that it seems like I have been forgetting about a file, but there are no more files other than the ones provided in the project files, correct? How can I make sure this error does not appear again?

I hope someone can help me out so I can start using a Child theme.

Thanks!

Nathalie

2 Answers

Jon W
Jon W
6,185 Points

The problem is that the parent "Next" theme is loading meta-box.php in it's own theme folder. But when you define a child theme it is looking for the file in the child theme folder, but since it's not there you get the error.

You could probably fix it by modifying functions.php in the parent theme, but you don't want to do that as it defeats the purpose. You can instead copy the files to the child theme. In this case try copying 'next/admin/meta-box/meta-box.php 'to 'nextchild/admin/meta-box/meta-box.php'. You may need to copy the entire 'meta-box' folder if it still complains.

Nathalie van Wijkvliet
Nathalie van Wijkvliet
4,819 Points

Hi Jon,

Thank you for helping me. I already thought it had something to do with the theme I picked. I tried it with another theme and did not have any problems. When I am going to work again with 'Next' I will definitely use your suggestions.

Cheers,

Nathalie