我的functions.php 上出现无法修改标头信息错误,更具体地说是它包含的文件(这不是问题)。
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 是我的 metabox 文件,我的所有代码都在其中。一切正常,除了尝试保存任何内容时,我得到一个空白页。保存成功,但我必须手动返回 wp-admin,这显然不是它应该如何工作的。
我的 metaboxes.php 代码是:
<?
// --- 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
?>
我真的不知道出了什么问题。它不能是空格,检查所有这些。