Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Last active August 29, 2015 14:02
Show Gist options
  • Save Willem-Siebe/b8d8c048c979976b8d63 to your computer and use it in GitHub Desktop.
Save Willem-Siebe/b8d8c048c979976b8d63 to your computer and use it in GitHub Desktop.
Overwrite Toolset Bootstrap parent theme widget arrays. For example, change 'aside' for sidebar widget to 'section' when using Toolset Bootstrap parent theme. Because of the 'if' statement in parent theme functions.php I can overwrite this by declaring the same function name in my child theme functions.php. Other method: http://wp-types.com/foru…
// Overwrite Toolset Bootstrap parent theme widget arrays, see https://gist.github.com/Willem-Siebe/b8d8c048c979976b8d63.
function wpbootstrap_register_sidebar() {
register_sidebar(array(
'name' => __('Sidebar', 'wpbootstrap'),
'id' => 'sidebar',
'description' => __('Appears on posts and pages except the optional full width page template', 'wpbootstrap'),
'before_widget' => '<section id="%1$s" class="wsis-widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h3 class="wsis-widget-title">',
'after_title' => '</h3>',
));
}
add_action('widgets_init', 'wpbootstrap_register_sidebar');
function wpbootstrap_register_footer_widgets() {
$widget_class = 'span4';
if (wpbootstrap_get_setting('general_settings', 'display_footer_widgets')) {
$widget_class = 'span' . intval(of_get_option('footer_widget_width'));
}
register_sidebar(array(
'name' => __('Footer widgets area', 'wpbootstrap'),
'id' => 'footer-widgets',
'description' => __('Appears above the footer', 'wpbootstrap'),
'before_widget' => '<section id="%1$s" class="wsis-widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h3 class="wsis-widget-title">',
'after_title' => '</h3>',
));
}
add_action('widgets_init', 'wpbootstrap_register_footer_widgets');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment