Multiple Sidebars in WP Framework?
I just upgraded to the newest version of WP Framework and I am having difficulty setting up multiple sidebars (which i was able to set up in the previous version).
I have edited the custom-functions.php file to include the code:
‘name’ => __( ‘Sidebar 1’, t() ),
‘id’ => ‘sidebar-1’,
‘description’ => __( ‘Asides widget area.’, t() ),
‘before_widget’ => ‘<section id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</section>’,
‘before_title’ => ‘<h3 class=”widgettitle”>’,
‘after_title’ => ‘</h3>’,
I then created a new “sidebar-1.php” file in which I copied all the code from “sidebar.php”. I then edited the line
* WordPress Template: Sidebar
changing it to
* WordPress Template: Sidebar 1
I then changed on of my custom templates (which is basically a copy of ‘page.php’ with an extra line of code near the top)
<?php get_template_part( ‘sidebar’ ); ?>
<?php get_template_part( ‘sidebar-1’ ); ?>
However, the page continues to show the “aside” sidebar that is default for the theme.
I know in the older version for this to work I also had to edit the line in “sidebar-1.php”
if ( !function_exists( ‘dynamic_sidebar’ ) || !dynamic_sidebar() ) : ?>
if ( !function_exists( ‘dynamic_sidebar’ ) || !dynamic_sidebar(1) ) : ?>
So I am assuming that there is more I need to edit in my new “sidebar-1.php”, but with the new ‘do_action’ commands I am at a loss as to what I should be editing.
Any help would be greatly appreciated.
Could be wrong, but isn’t the built-in WordPress method easier? I.e., created a new sidebar file called sidebar-whatever.php and then, in your template file, call get_sidebar(‘whatever’);
Or am I missing something else that you are trying to do?
Thanks for replying. 🙂
Aside from trying to maintain consistency in the code of the theme I am using, the get_sidebar() command is ineffective for the same reason that the get_template_part(sidebar-1) is ineffective. I’m assuming (and I could be wrong, but it is the only thing that is still differing from my previous installation of the last version of wp-framwork) that it is from lack of a
if (!function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar(1) ) : ?>in the sidebar-1.php file. Because the developers are not using that traditional code I neither know where to put said function in the new sidebar-1.php file or even better yet how to create the same effect while maintaining code consistency (which is really what I’m after). If you compare the code from the last version of wp-framwork and the new version for the sidebar.php file you should see what I am talking about.
- The topic ‘Multiple Sidebars in WP Framework?’ is closed to new replies.