Merge pull request #165 from johnnypeck/widgetsfix
Fix register sidebars so child themes can unregister them, thx @johnnypeck
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<footer id="content-info" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="contentinfo">
|
||||
<?php roots_footer_inside(); ?>
|
||||
<div class="container">
|
||||
<?php dynamic_sidebar("Footer"); ?>
|
||||
<?php dynamic_sidebar('roots-footer'); ?>
|
||||
<p class="copy"><small>© <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -65,17 +65,36 @@ function roots_setup() {
|
||||
|
||||
add_action('after_setup_theme', 'roots_setup');
|
||||
|
||||
// create widget areas: sidebar, footer
|
||||
$sidebars = array('Sidebar', 'Footer');
|
||||
foreach ($sidebars as $sidebar) {
|
||||
register_sidebar(array('name'=> $sidebar,
|
||||
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
|
||||
'after_widget' => '</div></article>',
|
||||
'before_title' => '<h3>',
|
||||
'after_title' => '</h3>'
|
||||
));
|
||||
/**
|
||||
* Register default roots sidebars.
|
||||
* Hook into 'widgets_init' function with a lower priority in your child
|
||||
* theme to remove these sidebars.
|
||||
*/
|
||||
function roots_register_sidebars() {
|
||||
register_sidebar(
|
||||
array(
|
||||
'id'=> 'roots-sidebar',
|
||||
'name' => __('Sidebar', 'roots'),
|
||||
'description' => __('Sidebar', 'roots'),
|
||||
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
|
||||
'after_widget' => '</div></article>',
|
||||
'before_title' => '<h3>',
|
||||
'after_title' => '</h3>'
|
||||
));
|
||||
register_sidebar(
|
||||
array(
|
||||
'id'=> 'roots-footer',
|
||||
'name' => __('Footer', 'roots'),
|
||||
'description' => __('Footer', 'roots'),
|
||||
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
|
||||
'after_widget' => '</div></article>',
|
||||
'before_title' => '<h3>',
|
||||
'after_title' => '</h3>'
|
||||
));
|
||||
}
|
||||
|
||||
add_action( 'widgets_init', 'roots_register_sidebars' );
|
||||
|
||||
// return post entry meta information
|
||||
function roots_entry_meta() {
|
||||
echo '<time class="updated" datetime="'. get_the_time('c') .'" pubdate>'. sprintf(__('Posted on %s at %s.', 'roots'), get_the_time('l, F jS, Y'), get_the_time()) .'</time>';
|
||||
|
||||
@@ -1 +1 @@
|
||||
<?php dynamic_sidebar("Sidebar"); ?>
|
||||
<?php dynamic_sidebar('roots-sidebar'); ?>
|
||||
Reference in New Issue
Block a user