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

PHP

Kat New
Kat New
751 Points

Issue with my functions.php file

It appears the my style.css file isn't working through the functions.php I'm getting the double title when I am expecting the CSS to remove this issue (therefore the CSS isn't working)

<code> <?php

function wpk_theme_styles() {

wp_enqueue_style('foundation_css', get_template_directory_uri(). '/css/foundations.css');
wp_enqueue_style('normalize_css', get_template_directory_uri(). '/css/normalize.css');
wp_enqueue_style('normalize_css', 'http://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic');
wp_enqueue_style('main_css' , get_template_directory_uri() . '/style.css');

}

add_action( 'wp_enqeue_scripts', 'wpk_theme_styles' );

function wpk_theme_js() {

wp_enqeue_script( 'modernizr_js', get_template_directory_uri() . '/js/modernizr.js', '', '', false );
wp_enqeue_script( 'foundation_js', get_template_directory_uri() . '/js/foundation.js', array('jquery'), '', true );
wp_enqeue_script( 'main_js', get_template_directory_uri() . '/js/app.js', array('jquery', 'foundation_js'), '', true );

}

add_action( 'wp_enqeue_scripts', 'wpk_theme_js' );

?> </code>

1 Answer

Bryan Lam
Bryan Lam
15,592 Points

You have 'enqeue' instead of "enqueue" starting from your first add_action call, through your entire script calls, and your second add_action call.

Trying switching all those and it should work!

Kat New
Kat New
751 Points

I knew there would be a simple spelling mistake! I ended up copying out the downloaded files - but it's good to know what I did wrong