Fields marked with an * are required

Adding Sidebar to WordPress theme. (WP 3)

  1. functions.php.txt
  2. sidebar-six.php.txt
  3. header.php.txt
  4. style.css


We have added a sidebar area just at the top of screen naming it SLIDER.

We are working in Twenty Eleven

While adding codes to all files we recommend you to download the attached files to have a better view of what we are doing.

Step 1 – Open functions.php in twenty eleven and add the following code, the same way we have added in downloaded file


// SLIDER sidebar code starts 

	register_sidebar( array(
		'name' => __( 'SLIDER', 'twentyeleven' ),
		'id' => 'slider',
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget' => "</aside>",
		'before_title' => '<h3 class="widget-title">',
		'after_title' => '</h3>',
	) );

// SLIDER sidebar code ends

Step 2 –  Create a sidebar-six.php file , and add the following code.


<div id="tnc_slider">


            <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('slider') ) : ?> 

            <?php endif; ?></ul>

Step 3 – Open header.php and add the following code in desired location. You can check where we added in headers.php that we have added.
<?php get_sidebar('six');?>
Step 4 – Open style.css and define css for #tnc_slider.
#tnc_slider {





Well this will create a new working sidebar .
Happy learning.
Scroll to Top