Fix register sidebars so child themes can unregister them.
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">
|
<footer id="content-info" class="<?php global $roots_options; echo $roots_options['container_class']; ?>" role="contentinfo">
|
||||||
<?php roots_footer_inside(); ?>
|
<?php roots_footer_inside(); ?>
|
||||||
<div class="container">
|
<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>
|
<p class="copy"><small>© <?php echo date('Y'); ?> <?php bloginfo('name'); ?></small></p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -65,17 +65,36 @@ function roots_setup() {
|
|||||||
|
|
||||||
add_action('after_setup_theme', 'roots_setup');
|
add_action('after_setup_theme', 'roots_setup');
|
||||||
|
|
||||||
// create widget areas: sidebar, footer
|
/**
|
||||||
$sidebars = array('Sidebar', 'Footer');
|
* Register default roots sidebars.
|
||||||
foreach ($sidebars as $sidebar) {
|
* Hook into 'widgets_init' function with a lower priority in your child
|
||||||
register_sidebar(array('name'=> $sidebar,
|
* theme to remove these sidebars.
|
||||||
'before_widget' => '<article id="%1$s" class="widget %2$s"><div class="container">',
|
*/
|
||||||
'after_widget' => '</div></article>',
|
function roots_register_sidebars() {
|
||||||
'before_title' => '<h3>',
|
register_sidebar(
|
||||||
'after_title' => '</h3>'
|
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
|
// return post entry meta information
|
||||||
function roots_entry_meta() {
|
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>';
|
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