2011-09-29 70 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

使用某些编码一些编辑器添加“戴德梁行”的文件的开头(这是不是在编辑器中显示。

相关问题