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 WordPress Header and Footer Templates Porting existing headers and footers into WordPress

Kyle Shamblin
Kyle Shamblin
9,945 Points

I can't seem to get my .js files to load properly.

I've re-watched the video several times to make sure that my syntax is correct, and even started the theme over from scratch, but nothing seems to be working. Maybe my file paths arent right? I'm using a cloud based IDE for development. Here is a link to my files: https://preview.c9users.io/kyleshamblin/wordpress/wp-content/themes/kyle-portfolio/

2 Answers

Hi again Kyle, I took a new look at your functions.php file. The get_template_directory_uri() function is right now, but I noticed a couple more things:

1. You need to use a different first argument in both of your add_action() functions. It should be like:

add_action( 'wp_enqueue_scripts', 'kyle_theme_styles' );
add_action( 'wp_enqueue_scripts', 'kyle_theme_scripts' );

It's "wp_enqueue_scripts" not "wp_enqueue_style".

2. Even though it actually will work as you wrote it, I'd still recommend that you remove the space between all your "wp_enqueue_style"s and their opening parentheses in your CSS enqueues block -- so that it's wp_enqueue_style( 'foundation_css' ..., etc. Writing PHP functions like my_function(); instead of my_function (); is way more conventional.

Hope that gets you on the right foot now! Good luck.

Kyle Shamblin
Kyle Shamblin
9,945 Points

Oh, wow. I don't know how I missed that, sorry about that. Thanks you so much for your help!

Hey Kyle, I think the problem is that you are using a WordPress function but you're using the wrong function name.

Yours: get_template_uri()

What it really is: get_template_directory_uri()

Here's the docs for it. Hope that's all it takes!

Kyle Shamblin
Kyle Shamblin
9,945 Points

Thanks Eric! I fixed the functions file, but it still can't get the "Portfolio" at the top of the page to display like it does in the video. (The square button look)