• Resolved forestrangermario

    (@forestrangermario)


    Warning: Cannot modify header information – headers already sent by (output started at /home/nvmain1/public_html/www2/wp-content/themes/theme/theme49248/includes/custom-js.php:16) in /home/nvmain1/public_html/www2/wp-includes/option.php on line 772

    Keep getting that error when I activate my new theme.
    I have no idea what I could of changed to cause this to happen because it was kind
    of overnight thing. One night it was fine, next morning it wasnt.

    Already deactivated all plugins, and error still shows up.

    New Vansterdam

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter forestrangermario

    (@forestrangermario)

    So from troubleshooting ive determined its line #16 in custom-js.php and if I open that file in the editor this is what I see.

    <?php
    add_action( 'wp_enqueue_scripts', 'custom_scripts' );
    
    function custom_scripts() {
        wp_enqueue_script( 'wpcf7', get_stylesheet_directory_uri() . '/js/wpcf7.js', array('jquery'), '1.0' );
    
        if ( !wp_script_is( 'googlemapapis', 'enqueued' ) ) {
    		wp_enqueue_script( 'googlemapapis', '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array( 'jquery' ), false, false );
    	}
    
    }?>
    <script type='text/javascript'>
    jQuery(document).ready(function($) {
    $('#nav a').attr('title', '');
    });
    </script>

    and line 16 is the “</script>” part so I dont know what to do with it.

    Thread Starter forestrangermario

    (@forestrangermario)

    Turns out I had to take out all of

    <script type='text/javascript'>
    jQuery(document).ready(function($) {
    $('#nav a').attr('title', '');
    });
    </script>

    even thought just the end of it was line #16

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cannot modify header information.’ is closed to new replies.