Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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)