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 trialKate McHugh
4,241 Pointsfunctions.php breaks wordpress
When there is code in the functions.php file, wordpress won't work / load. If I remove the code, it works again. Why would this be?
3 Answers
Ben Falk
3,167 PointsIf you add code to your functions.php file and it breaks Wordpress, that likely means you have an PHP error in your code. Can you post the code you are working with?
Andi Wilkinson
26,822 Pointscheck there are no spaces at the end of it!
patrick kellogg
7,579 Pointsan empty functions.php file with just this in it (i.e opening php tag with no closing php tag: ?> will also break it: this happened to me in the last lesson - it is always best practice not to use a closing php tag in a php file unless needed (see functions.php file in twentyfifteen theme to verify or google on it) but this appears to be a wordpress bug that only surfaces in a minimalistic barebones example such as this or midway through the last lesson.
<?php