getting error message “headers already sent” in wordpress

This is the error message I’m getting. I built my own theme and it pulls in a bunch of files with functions.php

Warning: Cannot modify header information - headers already sent by (output started at /home3/keganqui/public_html/dev/wp-content/themes/optimus/functions.php:5) in /home3/keganqui/public_html/dev/wp-includes/pluggable.php on line 866

Read More

new functions.php file, but the same error message occurs:

<?php require(TEMPLATEPATH . '/inc/misc.php'); ?>
<?php require(TEMPLATEPATH . '/inc/widgets.php'); ?>
<?php require(TEMPLATEPATH . '/inc/homepage.php'); ?>
<?php
/* Include back-end */
if(is_admin()){ include TEMPLATEPATH.'/panel/panel.php'; }

/* Include front-end */
if(!is_admin()){ include TEMPLATEPATH.'/panel/panel-front.php'; }
?>

Related posts

Leave a Reply

2 comments

  1. Chances are you have white space before your <?php tag. But as toscho said, please update your question with the first lines of functions.php

    UPDATE

    your functions file should be like this:

    <?php 
    require(TEMPLATEPATH . '/inc/misc.php');
    require(TEMPLATEPATH . '/inc/widgets.php');
    require(TEMPLATEPATH . '/inc/homepage.php'); 
    
    /* Include back-end */
    if(is_admin()){ include TEMPLATEPATH.'/panel/panel.php'; }
    
    /* Include front-end */
    if(!is_admin()){ include TEMPLATEPATH.'/panel/panel-front.php'; }
    ?>
    
  2. You must have only once your session_start() right after your opening php tag .
    If you have a main page and include in files with functions e.t.c dont put again the session_start() in those files. Just have one session_start at your main php file