WordPress.org

Ready to get started?Download WordPress

Forums

How to add another sidebar to the twenty ten theme - the styling??? (3 posts)

  1. Anna Lynge
    Member
    Posted 2 years ago #

    Hi

    I've read the post about adding another sidebar to twenty ten theme where Mattsay wrote:

    Yes it is possible. Just add this code to your functions.php file and it will add the sidebar to your theme:

    function add_my_sidebars(){
    register_sidebar( array(
    'name' => 'My sidebar',
    'id' => 'my-sidebar',
    'description' => 'Just a little description',
    'before_widget' => '<div id="%1$s" class="widget-container %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );
    } add_action('widgets_init', 'add_my_sidebars');

    Then add this simple code to your theme template (eg. sidebar.php) :

    <?php dynamic_sidebar('my-sidebar'); ?>

    ID values should match.

    I have added this to my page http://genanvendt.dk/ and the sidebar is there, but not in the right side where I want it. Probably because I haven't added the css/styling for this new sidebar. Does anyone know how to do this correctly?

    Thanks

  2. mukesh panchal
    Member
    Posted 2 years ago #

    add

    [ Moderator note: I've edited the post, but please enclose code snippets inside of the backtick character or use the code button. It makes it more readable that way. ]

    register_sidebar( array(
    		'name' => __( 'Home Page Box', 'twentyeleven' ),
    		'id' => 'sidebar-2',
    		'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => "</div>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );
  3. Anna Lynge
    Member
    Posted 2 years ago #

    What does this code do and in what file should I add it? I was actually asking about what to write in the CSS file? To make it appear in the right side.

    [ Please do not bump, it's not permitted here. ]

Topic Closed

This topic has been closed to new replies.

About this Topic