Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress

Wordpress Errors

I'm getting the following errors on my custom wordpress theme. The web address is saxon-gate.com.

These are the errors, how do I fix them:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'register_theme_menu' not found or invalid function name in /home/saxongate/public_html/wp-includes/plugin.php on line 496

Warning: Cannot modify header information - headers already sent by (output started at /home/saxongate/public_html/wp-includes/plugin.php:496) in /home/saxongate/public_html/wp-admin/post.php on line 235

Warning: Cannot modify header information - headers already sent by (output started at /home/saxongate/public_html/wp-includes/plugin.php:496) in /home/saxongate/public_html/wp-includes/pluggable.php on line 1196

2 Answers

ali abdulla
ali abdulla
8,084 Points

This may not be helpful as it has been so long, but i figured that since i found this thread while searching for a solution to my problem, maybe someone else would.

In regards to the third error that you got, i had the same issue and couldn't find a solution for it. I double checked my pluggable.php file and noticed that i had somehow either accidentally or through some other means managed to insert the letter "i" at the start of the file. once i have removed that everything worked perfectly.

Its such a silly thing but it wasted a good couple of hours of my time while i was trying to figure it out

This looks like two separate problems, the first of which is that a function register_theme_menu() is being called, but that function either hasn't been defined yet, or its definition got deleted somewhere along the line. Could you have meant to call register_nav_menu() instead?

The second set of errors tends to happen when your theme starts sending output and then tries to set HTTP header information. As soon as anything is echoed or printed, the headers have to be sent and then can't be modified. Have a look around the files in those two last errors for stray echo, print, or printr statements or white space surrounding your PHP opening and closing brackets. Alternately, find what's trying to set headers and remove that if it's not needed (look for 'send_headers', 'wp_headers', or similar).