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 WordPress Theme Development The WordPress Loop Common WordPress Functions Used with the Loop

Added loop code, and now my blog shows a blank white screen after I login.

I've been following along with the lessons, and my blog has worked fine up to this point. However, I started having problems after I added the loop code to my index.php file.

Every time I try to login to the Dashboard, I'm presented with a blank white screen. When I'm not logged in, the blog shows up fine.

The only way I've been able to fix this problem is by deleting the treehouse-theme files from File Manager, forcing my blog to revert to the default theme.

Please note that this blog is installed on a web host, not a local host.

Has anyone else experienced this problem?

Maybe your loop is infinite.. Could you post the code here?

Tautvydas, thanks for your response. Here is the code:

<?php get_header(); ?>


 <section class="row">
      <div class="small-12 columns text-center">
        <div class="leader">

        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

          <h1><?php the_title(); ?></h1>
          <p><?php the_content(); ?></p>
        <?php endwhile; else : ?>

            <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>

        <?php endif; ?>

        </div>
      </div>
    </section>

<?php get_footer(); ?>

Also, here is my functions.php file, if that helps:

<?php
function wpt_theme_styles() {
    wp_enqueue_style( 'normalize_css', get_template_directory_uri() . '/css/normalize.css' );
    wp_enqueue_style( 'googlefont_css', 'http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic' );
    wp_enqueue_style( 'foundation_css', get_template_directory_uri() . '/css/foundation.css' );
    wp_enqueue_style( 'main_css', get_template_directory_uri() . '/style.css' );
}
add_action('wp_enqueue_scripts', 'wpt_theme_styles');

function wpt_theme_js() {
    wp_enqueue_script( 'modernizr_js', get_template_directory_uri() . '/js/modernizr.js', '', '', false );
    wp_enqueue_script( 'foundation_js', get_template_directory_uri() . '/js/foundation.min.js', array('jquery'), '', true );
    wp_enqueue_script( 'main_js', get_template_directory_uri() . '/js/app.js', array('jquery', 'foundation_js'), '', true );
}
add_action( 'wp_enqueue_scripts', 'wpt_theme_js' );

?>

1 Answer

Sean T. Unwin
Sean T. Unwin
28,690 Points

Check your wp-config.php and functions.php to be sure there are not any empty lines after your closing php tags in those files.

If you have done that and still get the white screen of death, then rename your plugins temporarily to test if a plugin is causing an issue. You will likely have to do this through FTP or whichever means you connect to your server.

I hope that helps.

I removed some empty lines from functions.php, and it solved the problem. Thanks for your help!