Not working with my custom theme, yet.
-
Hello
I’m building a custom theme which has a very typical sidebar template but it doesn’t seem to work with your plugin. The sidebar works, the new widget area created with your plugin appears in the editor, but the original sidebar won’t change on the front-end.
Please let me know if you see something I’ve overlooked. Thank you.
functions.phpfunction register_widget_area2() {
register_sidebar(
array(
'id' => 'global-sidebar',
'name' => esc_html__( 'Global Sidebar', 'theme_name' ),
'description' => esc_html__( 'Add widgets and menus to any page.', 'theme_name' ),
'before_widget' => '<div class="spacer clear></div><li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4>'
)
);
}
In my template:echo '<div class="col-sm-3">';
get_sidebar('global-sidebar');
echo '</div>';
In sidebar-global-sidebar.php:echo '<ul class="sidebar">';
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('global-sidebar') ) :
endif;
echo '</ul>';
- The topic ‘Not working with my custom theme, yet.’ is closed to new replies.