• 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)

    (@sterndata)

    Volunteer Forum Moderator

    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

    (@maxoutin)

    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)

    (@sterndata)

    Volunteer Forum Moderator

    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.