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

Jason Early
Jason Early
52,944 Points

Bootstrap to WP site loads white

I'm working through the steps and I think my funcitons.php file is causing the site not to load but I can't see where. Help?

functions.php

<?php

// Load theme CSS function theme_styles() {

wp_enqueue_style('bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css');
wp_enqueue_style('main_css', get_template_directory_uri() . '/style.css');

} add_action('wp_enqueue_scripts', 'theme_styles'); // Load theme JS function theme_js() {

global $wp_scripts; 

wp_register_script( 'html5_shiv', 'https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js', '', '', false ); wp_register_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' );

$wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true );

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

//Enable Custom Menus add_theme_support ('menus');

function register_theme_menus() {

register_nav_menus (
    array(
    'header-menu' => __( 'Header Menu' )
        )
    );

} add_action('init', 'register_theme_menus'); ?>

1 Answer

Jason Early
Jason Early
52,944 Points

Weird. Looks like it was some whitespace error. Replaced it with the project file and it all works.

Also if you are using LiveReload its' browser extension may be causing conflicts with the php.