WordPress.org

Ready to get started?Download WordPress

Forums

warning: header already sent 'Help please' (18 posts)

  1. TBenson
    Member
    Posted 2 years ago #

    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

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

  3. TBenson
    Member
    Posted 2 years ago #

    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

  4. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

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

    Line 1 should be:

    <?php
    
    /** comments would be here followed by below**/
    
    ?><!DOCTYPE html>
  5. TBenson
    Member
    Posted 2 years ago #

    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' )
    ?>

  6. TBenson
    Member
    Posted 2 years ago #

    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

  7. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    <?php
    ?><!DOCTYPE html>

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

  8. TBenson
    Member
    Posted 2 years ago #

    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' )
    ?>

  9. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    What error comes up?

  10. TBenson
    Member
    Posted 2 years ago #

    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

  11. TBenson
    Member
    Posted 2 years ago #

    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' )?>

  12. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

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

  13. TBenson
    Member
    Posted 2 years ago #

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

  14. TBenson
    Member
    Posted 2 years ago #

    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">

  15. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

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

  16. @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?

  17. TBenson
    Member
    Posted 2 years ago #

    jan your awesome i deactivated the plugins one by one and found that when i deactivated the membership pluggin the error disappeared, of course now i guess i need to reload the membership pluggin??

  18. That would be a good way to go. Make sure you get the new copy of he membership plugin from the source.

Topic Closed

This topic has been closed to new replies.

About this Topic