• 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 https://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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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>',
    	) );

    Thread Starter Anna Lynge

    (@anna-lynge)

    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. ]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add another sidebar to the twenty ten theme – the styling???’ is closed to new replies.