Title: Sidebar &#8211; widget adding css
Last modified: August 20, 2016

---

# Sidebar – widget adding css

 *  Resolved [Copywrite](https://wordpress.org/support/users/copywrite2012/)
 * (@copywrite2012)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sidebar-widget-adding-css/)
 * Hi all
    I have the following code in my a sidebar (where the widgets are shown)
   php file which ic s included in my index page. I only have recent posts and categories
   in the widgets. The code seems to add html divs but I don’t know where it comes
   from. Where is the widget code stored? Thank you
 *     ```
       <?php if( is_home() || is_front_page() ) : ?>
       <!--shows if index -->
       <div class="art-sidebar1" style="padding-left: 15px;width:200px;">
       </div>
   
       <?php else : ?>
   
       <?php endif; ?>
   
       <?php if (!art_sidebar(1)): ?>
          <?php _e('Search', 'kubrick'); ?>
       <form method="get" name="searchform" action="<?php bloginfo('url'); ?>/">
       <input type="text" value="<?php the_search_query(); ?>" name="s" style="width: 95%;" />
       	<input class="art-button" type="submit" name="search" value="<?php _e('Search', 'kubrick'); ?>"/>
       </form>
           <?php _e('Bookmarks', 'kubrick'); ?>
       <ul>
             <?php wp_list_bookmarks('title_li=&categorize=0'); ?>
             </ul>
       <?php endif ?>
       </div>
       </div>
       ```
   

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

 *  [Kraignos](https://wordpress.org/support/users/kraignos/)
 * (@kraignos)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sidebar-widget-adding-css/#post-2151119)
 * Do you have any function called register_sidebar() in the file functions.php 
   of your theme? If so, check this reference, there are two arguments, “before_widget”,
   and “after_widget” which allow you to change the markup surrounding every widget
   added in this sidebar.
 * [http://codex.wordpress.org/Function_Reference/register_sidebar#Parameters](http://codex.wordpress.org/Function_Reference/register_sidebar#Parameters)
 *  Thread Starter [Copywrite](https://wordpress.org/support/users/copywrite2012/)
 * (@copywrite2012)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sidebar-widget-adding-css/#post-2151210)
 * Thanks that was very useful I just didn’t understand where it was coming from.
   I have now got rid of all the garbage formatting and left it like this:
 *     ```
       if (function_exists('register_sidebars')) {
       	register_sidebars(1, array(
       		'before_widget' => '<div id="%1$s" style="width:250px;float:left;">'.'<!--- BEGIN Widget --->',
       		'before_title' => '<!--- BEGIN WidgetTitle --->',
       		'after_title' => '<!--- END WidgetTitle --->',
       		'after_widget' => '<!--- END Widget --->'.'</div>'
       	));
       }
       ```
   
 *  [Kraignos](https://wordpress.org/support/users/kraignos/)
 * (@kraignos)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sidebar-widget-adding-css/#post-2151220)
 * Great ! So, problem resolved?
 *  Thread Starter [Copywrite](https://wordpress.org/support/users/copywrite2012/)
 * (@copywrite2012)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/sidebar-widget-adding-css/#post-2151372)
 * Yes thank you

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

The topic ‘Sidebar – widget adding css’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [Copywrite](https://wordpress.org/support/users/copywrite2012/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/sidebar-widget-adding-css/#post-2151372)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
