Welcome! To use this support forum, please Login or Join Today!

You are here → Home :: Forum Home :: General WordPress :: WordPress :: Thread

   

Headers already sent

{name}
Rank

Total Posts: 4

Joined 2011-05-09

PM

 
My site URL is: http://www.gorillamarketing.net

I am unable to edit my posts and pages right now. When I try, I get this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/gorilla/public_html/wp-content/themes/avalon/functions.php:23) in /home/gorilla/public_html/wp-includes/pluggable.php on line 897


Here's the offending section of pluggable.php:

if ( !function_exists('wp_redirect') ) :
/**
 * Redirects to another page.
 *
 * @since 1.5.1
 * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
 *
 * @param string $location The path to redirect to
 * @param int $status Status code to use
 * @return bool False if $location is not set
 */
function wp_redirect($location$status 302{
 
global $is_IIS;

 
$location apply_filters('wp_redirect'$location$status);
 
$status apply_filters('wp_redirect_status'$status$location);

 if ( !
$location ) / allows the wp_redirect filter to cancel a redirect
  
return false;

 
$location wp_sanitize_redirect($location);

 if ( !
$is_IIS && php_sapi_name() != 'cgi-fcgi' )
  
status_header($status); / This causes problems on IIS and some FastCGI setups

 header
("Location: $location"true$status);
}
endif; 
{name}
Rank

Total Posts: 4

Joined 2011-05-09

PM

 
Oh, nevermind, I think I fixed it. Per the Codex (http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F), I removed some whitespace before the last line in functions.php:

<?php
// Theme variables
require_once (TEMPLATEPATH '/lib/functions/theme.php');
//** ADMINISTRATION FILES **//
// Theme admin functions
require_once ($functions_path 'admin_functions.php');
// Theme admin options
require_once ($functions_path 'admin_options.php');
// Theme admin Settings
require_once ($functions_path 'admin_settings.php');
   
//** Frontend Display Functions **//
    // Widgets
    
require_once ($functions_path 'widgets_functions.php');

    
// Custom
    
require_once ($functions_path 'custom_functions.php');

    
// Comments
    
require_once ($functions_path 'comments_functions.php');
?>
<?php add_theme_support
'post-thumbnails' ); ?> 
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
Sometimes you just have to ask wink
{name}
Rank

Total Posts: 4

Joined 2011-05-09

PM

 
Seriously! I swear the fastest way to figure something out yourself is to ask someone else for help. raspberry