Title: Widgetizing my theme
Last modified: August 19, 2016

---

# Widgetizing my theme

 *  Resolved [cinco312](https://wordpress.org/support/users/cinco312/)
 * (@cinco312)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/)
 * I’m using the sodelicious-black-10 theme and it’s not “widgetized” I read this
   thread [http://automattic.com/code/widgets/themes/](http://automattic.com/code/widgets/themes/)
   and still don’t get it. What do I need to do to get this widgetized.
 * Thanks.

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

 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717221)
 * Well it’s pretty straightforward. You just add the code that Matt clearly provided
   inside the sidebar, where indicated. He also advises using h2 instead of h3 or
   some other class to style sidebar headings.
 * And he provides the code that should go into a new file called functions.php.
 * What is so difficult about this?
 *  Thread Starter [cinco312](https://wordpress.org/support/users/cinco312/)
 * (@cinco312)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717242)
 * So, basically I have to add everything he posted? I just didn’t wanna screw anything
   up. I know, I got to backup, I always backup first.
 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717244)
 * The only file you will be editing is `sidebar.php`. And you’ll be creating a 
   new file, `functions.php`. That’s it. Just rename the original file `sidebar.
   php.orig` or something before you go performing surgery on it. 🙂
 *  Thread Starter [cinco312](https://wordpress.org/support/users/cinco312/)
 * (@cinco312)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717252)
 * See, that’s the thing that confused me, I already have a functions.php. Erase
   that one and make the new one?
 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717253)
 * Can you cut and paste the contents of that file here?
 * Be sure to use a backtick (to the left of the 1/! key) before and after the code.
 * How much text is in that file?
 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717254)
 * Or email me off list (check my profile) and I can help you with it. 🙂
 *  Thread Starter [cinco312](https://wordpress.org/support/users/cinco312/)
 * (@cinco312)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717255)
 *     ```
       <?php
       function getWords($text, $limit)
       {
       $array = explode(" ", $text, $limit+1);
   
       if (count($array) > $limit)
       {
       unset($array[$limit]);
       }
       return implode(" ", $array);
       }
       ?>
       ```
   
 *  Thread Starter [cinco312](https://wordpress.org/support/users/cinco312/)
 * (@cinco312)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717256)
 * Not much in it, I’m sure It’ll screw something up if I delete it.
 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717260)
 * Leave what’s there alone. Just at the top, AFTER the top `<?php`
 * add this:
 *     ```
       if ( function_exists('register_sidebar') )
           register_sidebar();
       ```
   
 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717261)
 * You’re just adding another function. 🙂
 *  Thread Starter [cinco312](https://wordpress.org/support/users/cinco312/)
 * (@cinco312)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717263)
 * Thank you so much for your time and patience. BTW, I like your site, you do some
   nice work. I was going to gmail you for help, again, thanks. 🙂
 *  [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * (@jonimueller)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717264)
 * No problem. And if you get stuck, just holler! 🙂

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

The topic ‘Widgetizing my theme’ is closed to new replies.

## Tags

 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 12 replies
 * 2 participants
 * Last reply from: [jonimueller](https://wordpress.org/support/users/jonimueller/)
 * Last activity: [18 years, 3 months ago](https://wordpress.org/support/topic/widgetizing-my-theme/#post-717264)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
