error on search with one result (3 posts)

  1. strom
    Posted 12 years ago #

    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!!

  2. Stevarino
    Posted 12 years ago #

    It looks like a problem with your index.php file. Maybe a blank line or space before the "<?php"?

  3. strom
    Posted 12 years ago #

    Oh geesh, yes there was a space before the "<?php" ! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.