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 trialDaniel Hughes
2,854 PointsWhen Adding Bootstrap CSS via the functions.php File I get a server error. What am I doing wrong?
The other themes work just fine so I know its not wordpress or my local server. Here is my code:
FUNCTIONS.PHP <?php
function theme_styles() {
wp_enqueue_style(
'bootstrap_css',
get_template_directory_uri() . '/css/bootstrap.min.css'
);
}
add_action( 'wp_enqueue_scripts', 'theme_styles' );
?>
HEADER.PHP <? php wp_head(); ?>
Thanks
5 Answers
Joe Hartman
20,881 PointsThe code looks correct to me. Maybe double check your css folder and make sure that bootstrap.min.css is actually in there.
Daniel Hughes
2,854 PointsNot much to be more specific. It takes me to a blank white screen that just says "server error"
Daniel Hughes
2,854 PointsI will check on the folder structure thanks
Joe Hartman
20,881 PointsHas Wordpress loaded correctly in the past? It sounds like it's not now. I'd check and make sure both Apache and MySQL are running.
Malte Niepel
19,212 PointsI have the same problem and can't find a fix for it. Did you find the answer Daniel Hughes?
Sue Dough
35,800 PointsSue Dough
35,800 PointsCan you try being specific about the error?