• jquintana83

    (@jquintana83)


    Hello.

    I am trying to add a sidebar to one my pages. I have duplicated the sidebar page, the page template and modified it to include the new sidebar, and have changed the functions.php file to include the following:

    register_sidebar(array('name'=>'Commercial Sidebar','before_widget' => '<li>','after_widget' => '</li>','before_title' => '<h2>','after_title' => '</h2>',));

    I am able to see the Commercial Sidebar widget in the control panel but when I try to save I get the following error:

    Warning: Cannot modify header information – headers already sent by (output started at /home/jquintan/public_html/wp/wp-content/themes/iRealEstate/functions.php:1) in /home/jquintan/public_html/wp/wp-includes/pluggable.php on line 850

    Any help is greatly appreciatd!

Viewing 3 replies - 1 through 3 (of 3 total)
  • stvwlf

    (@stvwlf)

    generally this means you unintentionally added some white space (spaces, new lines, etc) at the beginning or end of the functions.php file. There can’t be a single character outside the opening and closing PHP tage.

    Thread Starter jquintana83

    (@jquintana83)

    Thanks, but there are no white spaces in the file. I have double checked. All I did was insert a line of code I copied (from the file itself) and change ‘Page’ to ‘Commercial’.

    I had this problem too. I solved it by deleting all blank space from the document. You can’t have any blank space anywhere in the function.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cannot Modify Header Information — New Sidebar’ is closed to new replies.