2011-09-29 67 views
-3

在我的(WordPress的)功能,當我試圖改變代碼1到代碼2我得到這個錯誤:不能更改頭信息 - 頭已經發出已

警告:不能更改頭信息 - 已經由(輸出發送頭開始在/home/consumer/public_html/themeforward.com/demo2/wp-admin/theme-editor中的/home/consumer/public_html/themeforward.com/demo2/wp-content/themes/Tutles/functions.php:1)。上的PHP線99

代碼1

array( 
    "name" => "Custom CSS", 
    "desc" => "Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: a.button{color:green}", 
    "id" => $shortname."_custom_css", 
    "type" => "textarea", 
    "std" => "" 
),  

代碼2

array( 
    "name" => "Link Color", 
    "desc" => "Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: a.button{color:green}", 
    "id" => $shortname."_link_color", 
    "type" => "textarea", 
    "std" => "" 
),  

線89 - 102:

// don't allow template files in subdirectories 
if (false !== strpos($basename, '/')) continue; 

$template_data = implode('', file($template)); 

$name = ''; 
if (preg_match('|Single Post Template:(.*)$|mi', $template_data, $name)) 
    $name = _cleanup_header_comment($name[1]); 

if (!empty($name)) { 
    if(basename($template) != basename(__FILE__)) 
     $post_templates[trim($name)] = $basename; 
} 

我爲如何解決這個問題完全糊塗了。

+1

'/可溼性粉劑內容/主題/ Tutles/functions.php:1'行1,可能是一個空格。 – Mob

回答

1

您可能創建了一個文件(或編輯文件)。我假設functions.php?

該文件中可能存在空白,在文件的開頭或結尾處。

爲了防止在文件末尾發生空白,只需刪除?>標記。此外,在每個文件的開頭刪除任何空白

0

你的php文件是用UTF8編碼的,沒有BOM? 如果不是,請按照這種方式進行編碼,然後重試。也許這就是你得到錯誤的方法

+2

對不起,編輯我的答案 –

0

你的第一個<?php標籤之前有空白空間或BOM。刪除它

0

使用某些編碼一些編輯器添加「戴德梁行」的文件的開頭(這是不是在編輯器中顯示。

相關問題