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

Marius Serban
7,083 PointsHow to Build a WordPress Theme - error on work.php page
Hi guys,
I have two problems building my WordPress Theme.
- Whenever I update any of my work pages I get a blank screen. I turned on the php errors and what I get is this:
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/allisongrayce.com/wp-content/themes/wpportfolio/functions.php:45) in /Applications/MAMP/htdocs/allisongrayce.com/wp-admin/post.php on line 235
Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/allisongrayce.com/wp-content/themes/wpportfolio/functions.php:45) in /Applications/MAMP/htdocs/allisongrayce.com/wp-includes/pluggable.php on line 1121
- Also, even though I have my images already in my media, when I am for example on Stop Visual Pollution page and I want to add the images to the post I get...nothing. The little circle, I don't know the name of it :P it keep loading and loading and nothing happens.
Thanks in advance!
7 Answers

Aaron Jackson
5,644 PointsI took a look at that pluggable.php screenshot...If your following along with the tutorial you don't need that pluggable file unless you have plans for it. But if you are going to use it. You might want to check out this link. http://codex.wordpress.org/Pluggable_Functions You will have to wrap your function with this ( !function_exists() ) otherwise you will get that error you getting. Hope this helps!

Aaron Jackson
5,644 PointsCan you post the code in your functions.php ?

Marius Serban
7,083 Pointshttps://www.dropbox.com/s/wlckvquwbuud1z2/1.png - post.php
https://www.dropbox.com/s/iveqz2e5acr6qmx/2.png - pluggable.php
Thanks!

Aaron Jackson
5,644 PointsThe code that you have a screenshot of looks fine. Can you show me what you have on line 45 in your functions.php file? Also, what part of the tutorial section are you on? That will help me narrow down exactly what section to look at.

Marius Serban
7,083 PointsHere is what I have on line 45 :)

Aaron Jackson
5,644 PointsTry changing line 24 to this
wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery') , '',true );

Marius Serban
7,083 PointsWarning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/allisongrayce.com/wp-content/themes/wpportfolio/functions.php:45) in /Applications/MAMP/htdocs/allisongrayce.com/wp-includes/pluggable.php on line 1121
This is what I get now. :(