WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Getting error: Warning: Cannot modify header information…

[Resolved] Getting error: Warning: Cannot modify header information…

  • I’ve read other posts about removing whitespace from the referenced file, but I didn’t find any whitespace that could be the culprit. This is on a fresh install of 3.6.1.

Viewing 9 replies - 1 through 9 (of 9 total)
  • WPyogi

    @wpyogi

    Forum Moderator

    We can’t see whitespace on a copy/paste of code – and that’s really too long to post here.

    What is the error you see?

    Warning: Cannot modify header information – headers already sent by (output started at /home2/jstudios/public_html/jframe.jirehstudios.com/wp-content/themes/js-theme/jframe/jframe-options.php:1) in /home2/jstudios/public_html/jframe.jirehstudios.com/wp-includes/option.php on line 571

    Warning: Cannot modify header information – headers already sent by (output started at /home2/jstudios/public_html/jframe.jirehstudios.com/wp-content/themes/js-theme/jframe/jframe-options.php:1) in /home2/jstudios/public_html/jframe.jirehstudios.com/wp-includes/option.php on line 572

    esmi

    @esmi

    Forum Moderator

    And is this in relation to a plugin or a theme?

    esmi

    @esmi

    Forum Moderator

    Ok, so I removed the “<style…” section i had at the beginning of the file because the link above says the file needs to start with <?php. Now it’s working.

    What’s the best way to include the styling in that file now?

    WPyogi

    @wpyogi

    Forum Moderator

    CSS should generally be in a .css file – it’s not meant to go in a .php file.

    Ok, so how do I relate the css file with he php file? If I include it do I just echo the style tags?

    WPyogi

    @wpyogi

    Forum Moderator

    If you are trying to add CSS to your site, I’d suggest using a custom CSS plugin.

    If you want to add whole file, see:

    http://codex.wordpress.org/Function_Reference/wp_enqueue_style

    Got it, I just registered and en-queued the stylesheet.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Getting error: Warning: Cannot modify header information…’ is closed to new replies.