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.

PHP How to Build a WordPress Theme Converting Static HTML into WordPress Templates Coding the Header and Footer Templates

Echo Syntax error

I'm watching Wordress video putting in what i believe to be same exact code and keep getting syntax error Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ')' in /home/odiwams1/public_html/wp-content/themes/cakedoubles/header.php on line 33


$args = array(
'menu'=> 'main-menu'
    'echo' => false


echo strip_tags( wp_nav_menu(  $args ) '<a>');


1 Answer

Tomas Dvorak
Tomas Dvorak
10,010 Points

Hi Robert,

i think you're missing a comma in the array declaration. Elements of the array must be separated by commas like this:

$args = array(
  'menu'=> 'main-menu',
  'echo' => false);

Along with the comma, there is missing closing bracket ')' and a semicolon as the END of a php statement.