Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

index.php Blank after Activating a Custom Theme

Followed the steps in the video: http://teamtreehouse.com/library/websites/how-to-build-a-wordpress-theme/wordpress-theme-templates/activating-a-custom-theme

When I went to the index.php file it is blank.

Saw a previous post about reinstalling Wordpress to fix this issue, but looking for a more efficient solution.

Could this be a caching issue. We've worked with Magento in the past and had similar experiences that were resolved by clearing the cache within the admin.

I'm developing locally on a Mac using MAMP.

Any assistance would be greatly appreciated.

Thank you,

-Tory

3 Answers

I haven't taken the Wordpress courses on treehouse, but I have set up and made custom themes for over 10 websites. With that said, you are saying that your index.php is empty. In the video the index.php is set up as follows:

<?php get_header(); ?>
<p>This is the index.php file.</p>
<?php get_footer(); ?>

Again, I'm not sure how the course is taught, but you should be fine with just editing the index.php and saving it.

Also if he is following the tutorial mentioned, he may be dealing with the front-page.php file instead of index.php.

Yeah, the video shows both index.php and front-page.php.

Thank you for the responses.

Both the index.php and front-page.php are blank when refreshing the browser even though the code on the page matches that which is in the tutorial video.

This post is about the same issue but I was trying to avoid a re-install of WP.

https://teamtreehouse.com/forum/my-portfolio-wordpress-site-is-still-blank-after-activating-a-custom-theme-video

-Tory

If the index.php or front-page.php have:

<p>Anything written here</p>

It most definitely should show up. Are you sure that the theme is selected and activated? What ever the problem may be, I'm almost certain a "re-install" of WP will not have to be performed.

wpportfolio theme is activated and files are exactly like in video.

I guess I'll try the re-install.

Thank y'all for the effort. :-)

Matt Campbell
Matt Campbell
9,767 Points

Tory Watson.

I don't know what text editor you're using, but make sure that you navigate to the page via your browser. WordPress is funny, it doesn't like you loading up a doc in your editor and then hitting the hotkey to open in browser.

Something to do with the WordPress engine...not sure on the details exactly but I'm guessing it gets started when you navigate via browser to a WordPress site.