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 Working with CSS and JS in WordPress Themes How to Link to JS from functions.php File

Jaimee Page
Jaimee Page
3,272 Points

Parse error unexpected T_function - localhost displaying HTTP error 500.

<? php function eph_theme_styles () { wp_enqueue_style('bootstrap_css', get_template_directory_uri() '/css/bootstrap.min.css'); wp_enqueue_style('opensans_css', 'https://fonts.googleapis.com/css?family=Open+Sans'); wp_enqueue_style('main_css', get_template_directory_uri() . '/style.css'); } add_action('wp_enqueue_scripts', 'eph_theme_styles');

function eph_theme_js () { wp_enqueue_script('bootstrap_js', get_template_directory_uri() . '/js/bootstrap.js', array('jQuery'), '', true); } add_action('wp_enqueue_scripts', 'eph_theme_js');

?>

This is the code I have written to turn my own static template into a wordpress theme following this video? Nothing works anymore!

1 Answer

Beth Palmer
Beth Palmer
1,113 Points

I had a similar problem. I took out the space between <? php so it read <?php and everything sprang to life again! Hope that helps.