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

Linking CSS tutorial problem

Hi, I've been following along with the course but I've run into a problem. With Linking CSS Tutorial When i add the extra 'u' to wp_enqeue -- wp_enqueue_style( 'normalize' , get_template_directiory_uri() . '/css/normalize.css' );-- the wordpress site now gives this error; Fatal error: Call to undefined function get_template_directiory_uri() in C:\xampp\htdocs\PP-Oct-29th\blog\wp-content\themes\pixelpanda\functions.php on line 5 - any help would be Great!

2 Answers

John Locke
John Locke
15,479 Points

Debugging WordPress errors is a good skill to practice. The first thing I would check is if there is a function named get_template_directory_uri() at the top of your function.php file. Check for typos, missing brackets, extra brackets. If all those check out fine, try to figure what part of the code changed when it stopped working. Does it work if you change it back? I Google the WordPress Codex all the time to try and figure out things just like this.

Yes definitely check to make sure your syntax is correct. I just ran into this problem now and it turns out I had accidentally pluralized the function like this:

wp_enqueue_styles('main', get_template_directory_uri() . '/style.css');

..when it should be

wp_enqueue_style('main', get_template_directory_uri() . '/style.css');

Doh!