-3

In my (WordPress) functions when I try to change Code 1 to Code 2 I get this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/consumer/public_html/themeforward.com/demo2/wp-content/themes/Tutles/functions.php:1) in /home/consumer/public_html/themeforward.com/demo2/wp-admin/theme-editor.php on line 99

Code 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" => ""
),      

Code 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" => ""
),      

Lines 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;
}

I am completely confused as to how to fix this.

realshadow
  • 2,599
  • 1
  • 20
  • 38
siouxfan45
  • 195
  • 2
  • 11

4 Answers4

1

You probably created a file (or edited a file). I assume functions.php?

There probably is a whitespace in that file, being it on the beginning of the file, or at the end.

To prevent whitespaces from happening on the end of the file, just remove the ?> tag. Also remove any whitespace at the beginning of every file

Rene Pot
  • 24,681
  • 7
  • 68
  • 92
0

Is your php file encoded in UTF8 without BOM ? If not, encode it this way and try again. maybe this is way you get the error

Alon Eitan
  • 11,997
  • 8
  • 49
  • 58
0

You have blank space or BOM before your first <?php tag. Remove it

genesis
  • 50,477
  • 20
  • 96
  • 125
0

When using certain encodings some editors add "dtž" at the beginning of the file (which is not shown in the editor.

Remc4
  • 1,044
  • 2
  • 12
  • 24