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

Yolanda Facio
Yolanda Facio
6,944 Points

White screen after adding 'function theme_js'

After adding the 'function theme_js' code, as outlined in video, when I refresh I get white screen and 500 (Internal Server Error) in console.

My code in functions.php file:

<?php

function theme_js() {

global $wp_scripts;

wp_enqueue_script( 'html5_shiv', 'https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js', '', '', false );
wp_enqueue_script( 'respond_js', 'https://oss.maxcdn.com/respond/1.4.2/respond.min.js', '', '', false );

$wp_scripts->add_data( 'html5_shiv', 'conditional' 'lt IE 9' );
$wp_scripts->add_data( 'respond_js', 'conditional' 'lt IE 9' );

} add_action( 'wp_enqueue_scripts', 'theme_js' );

?>

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

I would suggest commenting our all the code inside of the function then uncomment line by line to see what's causing the problem.