PHP Error – Cannot Modify Header

I encountered a strange problem when I tried out my theme on the actual server. At first I thought it was a problem with the search function as the search URL is wrong (it still is). But that error happened in the admin interface too.

I tried commenting out the only header() call I added in, which is in the header.php file and redirects the WordPress search function, but that didn’t make a difference too.

Finally, I took a really close look at the error message and noticed that it was complaining about line 21 in functions.php. The file only had 20 lines! Turns out that all I had to do was to remove the extra newline after the closing ?> tag.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s