0

Possible Duplicate:
Cannot modify header information - headers already sent, Why its happening
Headers already sent by PHP

I got the following error message on my wordpress dashboard.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homez.152/mamouman/www/wp-content/themes/arthur/functions.php:47) in /homez.152/mamouman/www/wp-content/themes/modularity/functions/admin-js.php on line 2`

Here is the content that i just added in my functions.php file

add_filter('wp_nav_menu_items','add_search_box', 10, 2);
function add_search_box($items, $args) {

    ob_start();
    get_search_form();
    $searchform = ob_get_contents();
    ob_end_clean();

    $items .= '<li>' . $searchform . '</li>';
return $items;
}

And here is my admin-js.php.

Community
  • 1
  • 1
Arthur Mamou-Mani
  • 2,303
  • 10
  • 43
  • 69

1 Answers1

0

The problem was simple to solve: ?> in functions.php had a space at its end.

Arthur Mamou-Mani
  • 2,303
  • 10
  • 43
  • 69
  • 1
    Leave that (the last closing `?>` at the end of the file) out, then this can not happen. It's a typical mistake. See [PHP Closing Tag](http://stackoverflow.com/questions/4410704/php-closing-tag) and [Why do some scripts omit the closing php tag '?>'?](http://stackoverflow.com/q/3219383/367456) – hakre Dec 21 '12 at 23:12