WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Cannot modify header information – headers already sent by functions.php

[Resolved] Cannot modify header information – headers already sent by functions.php

  • I keep getting the same error ever since I added a functions.php file to my theme:

    Warning: Cannot modify header information – headers already sent by (output started at /home/capstone/public_html/dev/chspp/wp-content/themes/cpp02/functions.php:1) in /home/capstone/public_html/dev/chspp/wp-includes/pluggable.php on line 897

    It’s weird, I’ve search everywhere and the solution appears to be one that recommends looking for and removing all trailing and leading spaces. I’ve found none, yet the problem still exists whenever I save a page.

    The functions.php code is:

    <?php
    function register_my_menus() {
      register_nav_menus(
        array('header-menu' => __( 'Header Menu' ), 'footer-menu' => __( 'Footer Menu' ) )
      );
    }
    
    add_action( 'init', 'register_my_menus' );
    ?>

    Any ideas on how I may fix this?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Cannot modify header information – headers already sent by functions.php’ is closed to new replies.
Skip to toolbar