Title: Problem updating for Widgets
Last modified: August 20, 2016

---

# Problem updating for Widgets

 *  [prb81](https://wordpress.org/support/users/prb81/)
 * (@prb81)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/problem-updating-for-widgets/)
 * I’m trying to figure out how to upgrade my theme to use Widgets. My current theme’s
   sidebar was within the code:
 *     ```
       <div id="sidebar">
       		<ul>
       [individual sidebar information within <li></li>]
                       </ul>
       	</div>
       ```
   
 * As instructed at [this link](http://codex.wordpress.org/Widgetizing_Themes) I
   took this to mean my theme was one of an unordered list. Therefore I added the
   following code at the top of my sidebar while closing it at the bottom:
 *     ```
       <?php if ( !dynamic_sidebar() ) : ?>
       ```
   
 * It then mentioned placing the following code in the functions.php file
 *     ```
       <?php
           register_sidebar();
       ?>
       ```
   
 * This is where I came stuck. I wasn’t sure where exactly to place it so I put 
   it at the very top. This allowed me to set up widgets, but when it came to adding
   a post, installing a widget or updating a page I was getting an error message
   in place of what should have been my admin pages. Is there something wrong with
   where I am placing the code in the functions file, if so, where should I place
   it, and if not have I gone about coding my sidebar file incorrectly?
 * Thanks for anyone who can provide some help.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [prb81](https://wordpress.org/support/users/prb81/)
 * (@prb81)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/problem-updating-for-widgets/#post-3062947)
 * I should point out that I went with the assumption my sidebar wasn’t a list and
   put the following code at the top of my functions page:
 *     ```
       <?php
           register_sidebar(array(
               'before_widget' => '',
               'after_widget' => '',
               'before_title' => '<h2>',
               'after_title' => '</h2>',
           ));
       ?>
       ```
   
 * It again shows the widgets, but when I go to add a new post or something to my
   site I get the following message:
 * > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/content/48/9255448/html/ALWAYSNEXTYEAR/wp-content/themes/any_white_v1.0/
   > functions.php:10) in /home/content/48/9255448/html/ALWAYSNEXTYEAR/wp-includes/
   > pluggable.php on line 881
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/problem-updating-for-widgets/#post-3062949)
 * Assuming your functions.php file already had an opening `<?php` tag, just add:
 *     ```
       register_sidebar(array(
       	'before_widget' => '',
       	'after_widget' => '',
       	'before_title' => '<h2>',
       	'after_title' => '</h2>',
       ));
       ```
   
 *  after that opening tag.
 *  Thread Starter [prb81](https://wordpress.org/support/users/prb81/)
 * (@prb81)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/problem-updating-for-widgets/#post-3062953)
 * Perfect. This has worked. I thank you.
 * One question on the side. Using the widgets for my sidebar has made the gap between
   the end of one widget and the title for the next quite crammed. Where would I
   adjust code or whatever in order to spread them out a little?
 * Thanks.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/problem-updating-for-widgets/#post-3062956)
 * You probably need to start editing your theme’s stylesheet. Try using Firefox
   with the Firebug add-on for this kind of CSS work.
    [http://getfirebug.com/](http://getfirebug.com/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Problem updating for Widgets’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/problem-updating-for-widgets/#post-3062956)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
