SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy headers already sent: cannot solve it

    I want to use this wp theme from smashingmagazine dot com /2009/01/28/vintage-and-blues-wordpress-themes/
    on WP 2.7.1 but get this

    Warning: Cannot modify header information - headers already sent by (output started at /home/.../wp-content/themes/wordpress-blue/functions.php:11) in /home/.../wp-includes/pluggable.php on line 856

    I read the article on tech-recipes dot com /rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/
    but still can't see how to solve the problem

    functions.php contains
    PHP Code:

    <?php
    if ( function_exists('register_sidebar') )
        
    register_sidebars(2, array(
            
    'before_widget' => '<ul class="category-bg">',
            
    'after_widget' => '</ul>',
            
    'before_title' => '<h2>',
            
    'after_title' => '</h2>',
        ));
    ?>

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Most likely cause is a space before the <
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,397
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    Since the offending output occurred on line 11, it is probably whitespace after the closing PHP tag (?>).
    Attached Files Attached Files
    Last edited by Salathe; Jun 2, 2009 at 15:13.
    Salathe
    Software Developer and PHP Manual Author.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The error reports the line where the header is attempting to be written out. The content it is complaining about can be anywhere in the file above that. The most common place is right at the top with space at the start of line 1.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •