I have a feeling there's going to be a really simple answer to this, but I can't see it and it's driving me mad! Hope someone can help.
I have a load of custom functions in my theme's functions.php that I want to shift into another file to tidy things up a bit. They deal with creating a theme options admin panel.
I cut and paste these functions into said new file, and include it with
require_once(TEMPLATEPATH . '/filename.php');
I reload the admin panel. WP gives the error "You do not have sufficient permissions to access this page."
Why?! I've checked the new file's actually being included by adding
echo "test"; in it, which promptly displays above the wordpress error. I've also checked the logs and PHP doesn't throw an error.
Any ideas anyone? I'm completely at a loss!