Title: Custom widget sidebar
Last modified: March 22, 2021

---

# Custom widget sidebar

 *  [maxoutin](https://wordpress.org/support/users/maxoutin/)
 * (@maxoutin)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-widget-sidebar-2/)
 * Hello All, I have created a custom widget for the sidebar and I would like to
   know how can i change the location of the sidebar where I want to.
 *     ```
       add_action( 'widgets_init', 'my_register_sidebars' );
       function my_register_sidebars() {
           /* Register the 'primary' sidebar. */
           register_sidebar(
               array(
                   'id'            => 'primary',
                   'name'          => __( 'Primary Sidebar' ),
                   'description'   => __( 'Sidebar is for recent statistics' ),
                   'before_widget' => '<div id="%1$s" class="widget %2$s">',
                   'after_widget'  => '</div>',
                   'before_title'  => '<h3 class="widget-title">',
                   'after_title'   => '</h3>',
               )
           );
           /* Repeat register_sidebar() code for additional sidebars. */
       }
       ```
   
 * this is the code i used in order to create my sidebar

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

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-widget-sidebar-2/#post-14217761)
 * The sidebar is displayed when you add a call to `dynamic_sidebar( 'primary' );`
   someplace in a theme file; the location is up to you.
 *  Thread Starter [maxoutin](https://wordpress.org/support/users/maxoutin/)
 * (@maxoutin)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-widget-sidebar-2/#post-14221361)
 * I have successfully moved my sidebar on the right but I also want to be on the
   top of the window and not down I tried moving it with CSS top/bottom but is not
   working.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 2 months ago](https://wordpress.org/support/topic/custom-widget-sidebar-2/#post-14223598)
 * Please provide a link to a page on your site where we can see this. Thanks. _Note:
   Your link will be public and we will not later remove it._

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

The topic ‘Custom widget sidebar’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/custom-widget-sidebar-2/#post-14223598)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
