WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Getting error: Warning: Cannot modify header information... (10 posts)

  1. jstudios
    Member
    Posted 9 months ago #

    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.

  2. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    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?

  3. jstudios
    Member
    Posted 9 months ago #

    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

  4. esmi
    Forum Moderator
    Posted 9 months ago #

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

  5. esmi
    Forum Moderator
    Posted 9 months ago #

    A theme. Try reviewing Solving "headers already sent" warnings.

  6. jstudios
    Member
    Posted 9 months ago #

    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?

  7. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

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

  8. jstudios
    Member
    Posted 9 months ago #

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

  9. WPyogi
    Volunteer Moderator
    Posted 9 months ago #

    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

  10. jstudios
    Member
    Posted 9 months ago #

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

Reply

You must log in to post.

About this Topic