WordPress.org

Support

Support » How-To and Troubleshooting » warning: header already sent 'Help please'

warning: header already sent 'Help please'

  • this error is blocking my blog and footer from showing,
    i have deleted any white space before open tag in header-php file and after the closing tag, have tried <? ob_start(); ?> <? ob_flush(); ?>
    i have included the header-php code (error states it is on line 2 but i dont know php so not sure what could be problem) appreciate any suggestions

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php wp_title(); ?></title>
    <?php wp_head(); ?>
    </head>
    <body id=”<?php prima_option(‘themelayout’) ?>” <?php body_class(); ?>>
    <?php if(prima_get_option(‘usernav’)&&class_exists(‘WP_eCommerce’)) get_template_part( ‘flexi-usernav’ )
    ?>

    Warning: Cannot modify header information – headers already sent by (output started at /home/nickcher/public_html/wp-content/themes/yourflexishop/header.php:2) in /home/nickcher/public_html/wp-includes/pluggable.php on line 86

Viewing 15 replies - 1 through 15 (of 17 total)
  • yes i read that post and tried all those things nothing works thats why i included the code maybe someone else can see something im not seeing but thanks

    Are lines 1 and 2 of header.php shown above?

    Line 1 should be:

    <?php
    
    /** comments would be here followed by below**/
    
    ?><!DOCTYPE html>

    yes this is the exact code as shown above so should it be like this
    <?php
    <!DOCTYPE html>
    <html language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php wp_title(); ?></title>
    <?php wp_head(); ?>
    </head>
    <body id=”<?php prima_option(‘themelayout’) ?>” <?php body_class(); ?>>
    <?php if(prima_get_option(‘usernav’)&&class_exists(‘WP_eCommerce’)) get_template_part( ‘flexi-usernav’ )
    ?>

    i guess that wasnt rt the way i tried it because i lost thw whole page and just got this error

    Parse error: syntax error, unexpected ‘<‘ in /home/nickcher/public_html/wp-content/themes/yourflexishop/header.php on line 2

    <?php
    ?><!DOCTYPE html>

    Should work in your case. You are missing the closing ?> of the first php line

    well i have literally been trying stuff since 8am this is the new code and the only thing that changed was the line error went from 2 to 5 the line about the blog and thats the problem the error comes up where blog should be. 🙁
    <?php
    ?><!DOCTYPE html>
    <html language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php wp_title(); ?></title>
    <?php wp_head(); ?>
    </head>
    <body id=”<?php prima_option(‘themelayout’) ?>” <?php body_class(); ?>>
    <?php if(prima_get_option(‘usernav’)&&class_exists(‘WP_eCommerce’)) get_template_part( ‘flexi-usernav’ )
    ?>

    What error comes up?

    this the original
    Warning: Cannot modify header information – headers already sent by (output started at /home/nickcher/public_html/wp-content/themes/yourflexishop/header.php:2) in /home/nickcher/public_html/wp-includes/pluggable.php on line 86
    this is the new one-
    Warning: Cannot modify header information – headers already sent by (output started at /home/nickcher/public_html/wp-content/themes/yourflexishop/header.php:2) in /home/nickcher/public_html/wp-includes/pluggable.php on line 866

    btw i really appreciate you trying to help .
    seems like whenever i changed the code around it just changed the line error i also tried this code(no luck)
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
    “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
    <html xmlns=”http://www.w3.org/1999/xhtml” <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php wp_title(); ?></title>
    <?php wp_head(); ?>
    </head>
    <body id=”<?php prima_option(‘themelayout’) ?>” <?php body_class(); ?>>
    </body>
    </html>
    <?php if(prima_get_option(‘usernav’)&&class_exists(‘WP_eCommerce’)) get_template_part( ‘flexi-usernav’ )?>

    Upload a fresh copy (unmodified) of the header.php file…

    i tried that too from a completly new download of the theme, i’ll try again see if the error changes any

    heres the code from the new download in a different site that works fine i think the error must be some place else because even the new code throws same error for line 2
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php wp_title(); ?></title>
    <?php wp_head(); ?>
    </head>
    <body id=”<?php prima_option(‘themelayout’) ?>” <?php body_class(); ?>>
    <?php if(prima_get_option(‘usernav’)&&class_exists(‘WP_eCommerce’)) get_template_part( ‘flexi-usernav’ ); ?>
    <div id=”flexi-wrapper”>

    Do not use this theme, switch to the default one.

    Moderator Jan Dembowski

    @jdembowski

    Brute Squad and Volunteer Moderator

    @tbenson? Friend? Please use the code button. It’s a seeing eye thing with me. Much thanks. 😉

    Have you tried:

    – deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the Twenty Eleven theme to rule out any theme-specific problems.

    resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    – re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.

    Warning: Cannot modify header information

    I know you’d been given this link already but have you tried it out?

    http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

    Make a safe backup copy of your existing wp-config.php file. Make sure that’s somewhere safe and call it wp-config-SAVE.php.

    Now copy over wp-config-sample.php on top of your wp-config.php file. You did make that backup copy, right?

    Now edit the new wp-config.php file with your details like so (see what I did with the code button?):

    // ** MySQL settings ** //
    define('DB_NAME', 'your-db-name');    // The name of the database
    define('DB_USER', 'your-db-user');     // Your MySQL username
    define('DB_PASSWORD', 'your-db-password'); // ...and password
    etc.

    Save that and visit your site. Did that fix the error?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘warning: header already sent 'Help please'’ is closed to new replies.
Skip to toolbar