I am getting a cannot modify header information error on my functions.php, more specifically a file it's including (which is not the issue).
Warning: Cannot modify header information - headers already sent by (output started at /home/yc/domains/yc.keytoe.nl/public_html/wp-content/themes/yourconnector/inc/metaboxes.php:6) in /home/yc/domains/yc.keytoe.nl/public_html/wp-includes/pluggable.php on line 881
Metaboxes.php is my metabox file, where I have all my code for just that. Everything works fine except when trying to save anything, I get a blank page. The save is succesful but I have to manually go back to wp-admin and that obviously isn't how it's supposed to work.
My metaboxes.php code is:
<?
// --- METABOX CREATE --- //
add_action('admin_init', 'page_spec_meta');
function page_spec_meta(){
(this is line 6) $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; $template_file = get_post_meta($post_id,'_wp_page_template',TRUE);
if ($template_file == 'talenten.php')
{
add_meta_box("career-meta", "Career", "career_meta", "page", "normal", "high");
add_meta_box("business-meta", "Business", "business_meta", "page", "normal", "high");
add_meta_box("inspired-meta", "inspired", "inspired_meta", "page", "normal", "high");
add_meta_box("network-meta", "Network", "network_meta", "page", "normal", "high");
add_meta_box("future-meta", "Future", "future_meta", "page", "normal", "high");
}
if ($template_file == 'bedrijven.php')
{
add_meta_box("unique-meta", "Unique", "unique_meta", "page", "normal", "high");
add_meta_box("providing-meta", "Providing", "providing_meta", "page", "normal", "high");
add_meta_box("inspired-meta", "inspired", "inspired_meta", "page", "normal", "high");
add_meta_box("network-meta", "Network", "network_meta", "page", "normal", "high");
add_meta_box("future-meta", "Future", "future_meta", "page", "normal", "high");
}
}
....rest of the page
?>
I can't really figure out what's wrong. It can't be whitespaces, checked all that.