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 trialpatrick kellogg
7,579 Pointsafter copying the source from jumbotron into my theme's index.php file, I get a blank screen when i view my site.
any ideas?
patrick kellogg
7,579 Pointstwentyfifteen's functions.php file does not explicitly close out php with a ?> at the bottom of the file. So, 2015 is abiding by best practices. But in our bare bones example here it is required. this exposes a subtle bug in wordpress. LOL.
7 Answers
Sue Dough
35,800 PointsPaste your code otherwise its near impossible to help you. My guess is you didn't include get_header and get_footer.
patrick kellogg
7,579 Pointsmaybe i wasn't clear - i figured it out - this is what breaks it :
in functions.php if you just have this in the file with nothing else such as code or a closing php tag: ?> at the end of the file it breaks and produces no output
<?php
// without this at the end of the file: ?> it breaks and produces no output
patrick kellogg
7,579 Pointswith ide's, such as phpstorm when you create a new php file it create this for you:
<?php
// with no ?> closing tag because having a closing tag when not needed is bad practice // this breaks it and produces no output // a ?> closing tag is needed // with the functions.php file in a theme that is more than a barebones the closing ?> is never there // such as in twentyfifteen
a subtle bug in wordpress
patrick kellogg
7,579 Pointsi hope you understand, if not, let me know an i will send u the code. then u will be enlightened a bit. thanks
patrick kellogg
7,579 Pointscode typed in here gets truncated and screwed up - this form doesn't handle code very gracefully
Sue Dough
35,800 PointsCode works perfect man. You just didn't use the markdown for it properly. Do 3 ticks around the code ``` on the opening and closing.
patrick kellogg
7,579 Pointsthis problem occurred before i got to the part of chopping up index.php into headers and footers the index.php can be as simple as this:
<!DOCTYPE html> <html lang="eng"> <head> <meta charset="utf-8"> <title></title> </head> <body> <h1>test</h1> </body> </html>
patrick kellogg
7,579 Pointsit sounds weird but it is. it is a subtle bug. thanks though
patrick kellogg
7,579 Pointspatrick kellogg
7,579 Pointsi use phpstorm and functions.php being this caused the problem: <?php