Support » Fixing WordPress » error on search with one result

  • I’ve just discovered that if I perform a search and only one result is returned, the following error shows up at the top of the web page:
    Warning: Cannot add header information – headers already sent by (output started at
    /Library/Webserver/Documents/RsBlog/index.php:1) in /Library/Webserver/Documents/RsBlog/wp-blog-header.php on line 359
    A look at line 358-360 in the wp-blog-header file (which I’ve not touched) is:
    if ($s && empty($paged)) { // If they were doing a search and got one result
    header(‘Location: ‘ . get_permalink($posts[0]->ID));
    The error doesn’t occur if 0 or >1 search results are returned. Turning off the two additions I made using the my-hacks method doesn’t resolve the problem. Any ideas what’s going on? Thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘error on search with one result’ is closed to new replies.