Display custom sidebar in custom template
-
Hey!
I’m using the twentyeleven theme, if that makes a difference.
I’ve read few some posts about using a custom sidebar but I’m a little unclear as to what I need to do.
I have created a new sidebar (I think) using this code in the functions.php file:
register_sidebar( array( 'name' => __( 'Project Sidebar', 'twentyeleven' ), 'id' => 'sidebar-6', 'description' => __( 'Sidebar for projects template', 'twentyeleven' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => "</aside>", 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>',
Basically, I just copied this code from an existing register_sidebar() already in functions.php and modified the name, id, and description array elements.
However, this new sidebar doesn’t show up in the list of sidebars on the Appearance -> Widgets in the Admin page. I’m not sure why this is happening.
To use this sidebar in my ‘Projects” template instead of the default sidebar, do I use the dynamic_sidebar() function in some way? Or should I create a new .php file called called project-sidebar.php and use the get_sidebar() function?
I’m a little confused ??
Any help is much appreciated!
- The topic ‘Display custom sidebar in custom template’ is closed to new replies.