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

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

<?php

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