Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Creating a Static Page Template with Sidebar

Pierre Smith
Pierre Smith
11,842 Points

I get errors whenever I try to update my content in WP.

Whenever I try to add content to through the edit page I get these two errors. Can anyone explain why this might happen?

Warning: Cannot modify header information - headers already sent by (output started at /Users/kipp0/Sites/wordpress/pssp.on.ca/wp-content/themes/pssp/functions.php:127) in /Users/kipp0/Sites/wordpress/pssp.on.ca/wp-admin/post.php on line 242

Warning: Cannot modify header information - headers already sent by (output started at /Users/kipp0/Sites/wordpress/pssp.on.ca/wp-content/themes/pssp/functions.php:127) in /Users/kipp0/Sites/wordpress/pssp.on.ca/wp-includes/pluggable.php on line 1207

1 Answer

rydavim
rydavim
18,813 Points

Disclaimer: I am not a Wordpress or PHP expert. I've only done the basic Wordpress courses on usage.

Without seeing the code these two errors are referencing, there are two things I can suggest looking into.

First - make sure you have no extra whitespace or php tags near where the errors indicate.

Warning: Cannot modify header information - headers already sent by (output started at /Users/kipp0/Sites/wordpress/pssp.on.ca/wp-content/themes/pssp/functions.php:127) in /Users/kipp0/Sites/wordpress/pssp.on.ca/wp-admin/post.php on line 242

I believe, The first bolded section indicates the item that sent output before the headers, followed by the line trying to send the headers after the output.

Second - if that doesn't seem to solve your issue, confirm that your file is encoded correctly. You probably want this to be UTF-8 without BOM.

Hopefully at least one of those can help you track down the problem.

Pierre Smith
Pierre Smith
11,842 Points

But why would there be something in post.php if I've never touched that file?

rydavim
rydavim
18,813 Points

Apologies for the delay, I'm on vacation and not checking the forums as much as I normally would.

It's difficult to say what might have caused the behavior you're seeing. Maybe a theme or mod you're using? Sometimes things interact in ways we don't necessarily expect. Usually reverting to one of the included base themes can help you rule out theme issues.

Unfortunately, I'm not a Wordpress expert, but if you've noticed something else specific I'll do my best to help you investigate. :)