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 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.