WordPress.org

Ready to get started?Download WordPress

Forums

Cannot modify header information (3 posts)

  1. myzticshadow146
    Member
    Posted 7 years ago #

    I am trying to widgetize the theme fspring. I didn't have a functions.php file, so I created it and put in the following code.

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar();
    ?>

    After adding the sections of code to the sidebar, the widgets worked fine. But I am now getting a "Cannot modify header information" error very frequently. I understand that this means that there is excess whitespace in one of my files.

    wp-content/themes/fspring/functions.php:1)

    I looked at line one in my functions.php file, but the only thing on that line is

    <?php

    I tried the technique of holding backspace between the < and the ?, but that didn't work.

    I am absolutely flabbergasted. I have tried everything mentioned on any threads I could find about this, but to no avail.

    Does anyone have any idea what is wrong?

  2. Trent Adams
    Member
    Posted 7 years ago #

    Hmm....without getting into it, maybe this will help?

    http://automattic.com/code/widgets/themes/

    Trent

    EDIT:

    As well sorry:

    http://codex.wordpress.org/Plugins/WordPress_Widgets#Resources

  3. Doodlebee
    Member
    Posted 7 years ago #

    How about whitespace at the end? After the closing ?>

    You can't have any after that, either.

Topic Closed

This topic has been closed to new replies.

About this Topic