milohuang / reverie

Reverie is a versatile HTML5 responsive WordPress framework based on ZURB's Foundation.
http://theakiba.com/reverie/
MIT License
916 stars 196 forks source link

syntax error, unexpected T_FUNCTION in functions.php #72

Closed Narga closed 12 years ago

Narga commented 12 years ago

Ahh, I confused with this error. On localhost, reverie working perfect but when I upload it on to my webhosting (HostGator) then active this theme, I've got blank page. I set WP_DEBUG to true then try again, it's tell me Parse error: syntax error, unexpected T_FUNCTION in /public_html/wp-content/themes/reverie/functions.php on line 198

awshout commented 12 years ago

I'm guessing your local host is PHP 5.3 and HostGator is PHP 5.2.x. You could either change to PHP 5.3 or change the function. http://support.hostgator.com/articles/hosting-guide/hardware-software/php-5-3

// Add Foundation 'active' class for the current menu item
add_filter('nav_menu_css_class' , 'add_active_class', 10 ,2);
function add_active_class($classes, $item){
        if($item->current == 1){ //Notice you can change the conditional from is_single() and $item->title
                 $classes[] = "active";
        }
        return $classes;
}

hope that helps :]

Narga commented 12 years ago

Thanks! It's working like charm