WordPress.org

Ready to get started?Download WordPress

Forums

error on search with one result (3 posts)

  1. strom
    Member
    Posted 10 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:
    <pre>
    if ($s && empty($paged)) { // If they were doing a search and got one result
    header('Location: ' . get_permalink($posts[0]->ID));
    }
    </pre>
    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
    Member
    Posted 10 years ago #

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

  3. strom
    Member
    Posted 10 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

Tags

No tags yet.