Title: widgetizing areas
Last modified: August 20, 2016

---

# widgetizing areas

 *  Resolved [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * (@bluedrag)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/widgetizing-areas/)
 * Hello WordPress,
 * I’m trying to add a widget area to my theme.. It doesn’t seem to be working though..
   I’ve done this before so I’m sure it’s just something small and stupid thats 
   stopping it from working this time.. Maybe someone here can help me.
 * Here is the code in my html file
 *     ```
       <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(searchbar) ) : ?>
       	<?php endif; ?>
       ```
   
 * Here is the code in my functions.php
 *     ```
       <?php
   
       if ( function_exists('register_sidebar') )
       register_sidebar(array(
       'name' => 'searchbar',
       'before_widget' => '',
       'after_widget' => '',
       'before_title' => '',
       'after_title' => '',
       ));
   
       ?>
       ```
   

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

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/widgetizing-areas/#post-2383310)
 *     ```
       <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(searchbar) ) : ?>
       	<?php endif; ?>
       ```
   
 * You are excluding with the !. That says if there is no dynamic sidebar, so WP
   would then be looking for code to display if the sidebar doesn’t exist.
 * THe markup I use in my html looks like:
 *     ```
       <?php if ( is_active_sidebar( 'searchbar' ) ) : ?>
       	<div class="post post-widget-area hentry">
       		<ul class="xoxo">
       			<?php dynamic_sidebar( 'searchbar' ); ?>
       		</ul>
       	</div><!-- #first .widget-area -->
       <?php endif; ?>
       ```
   
 * [http://vudu.me/k](http://vudu.me/k)
    for a little writeup
 *  Thread Starter [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * (@bluedrag)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/widgetizing-areas/#post-2383594)
 * Hey, thanks for your help, I wrote it out a little bit differently, but you were
   right about what I was doing wrong thank you. This is what I used (in the html
   file)
 *     ```
       <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('searchbar')) : else : ?>
       <?php endif; ?>
       ```
   

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

The topic ‘widgetizing areas’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/widgetizing-areas/#post-2383594)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
