Additional Sidebars Problem
-
I hope someone here can help me. I have been trying to add 4 additional sidebars to the Courage theme to fill them with widgets, as this theme by default comes with only two sidebars for the magazine homepage and the right sidebar. I found a tutorial here and made changes to my child theme folder as follows:
functions.php:
register_sidebar (array ()
‘name’ => ‘Footer Sidebar 1’,
‘id’ => ‘footer-sidebar-1’,
‘description’ => ‘Appearance in the footer area’,
‘before_widget’ => ‘<aside id = “% 1 $ s” class = “widget% 2 $ s”>’,
‘after_widget’ => ‘</ aside>’,
‘before_title’ => ‘<h3 class = “widget-title”>’,
‘after_title’ => ‘</ h3>’,
));
register_sidebar (array ()
‘name’ => ‘Footer Sidebar 2’,
‘id’ => ‘footer-sidebar-2’,
‘description’ => ‘Appearance in the footer area’,
‘before_widget’ => ‘<aside id = “% 1 $ s” class = “widget% 2 $ s”>’,
‘after_widget’ => ‘</ aside>’,
‘before_title’ => ‘<h3 class = “widget-title”>’,
‘after_title’ => ‘</ h3>’,
));
register_sidebar (array ()
‘name’ => ‘Footer Sidebar 3’,
‘id’ => ‘footer-sidebar-3’,
‘description’ => ‘Appearance in the footer area’,
‘before_widget’ => ‘<aside id = “% 1 $ s” class = “widget% 2 $ s”>’,
‘after_widget’ => ‘</ aside>’,
‘before_title’ => ‘<h3 class = “widget-title”>’,
‘after_title’ => ‘</ h3>’,
));
register_sidebar (array ()
‘name’ => ‘Footer Sidebar 4’,
‘id’ => ‘footer-sidebar-4’,
‘description’ => ‘Appearance in the footer area’,
‘before_widget’ => ‘<aside id = “% 1 $ s” class = “widget% 2 $ s”>’,
‘after_widget’ => ‘</ aside>’,
‘before_title’ => ‘<h3 class = “widget-title”>’,
‘after_title’ => ‘</ h3>’,
));footer.php:
<div id = “footer-sidebar” class = “secondary”>
<div id = “footer-sidebar1”>
<? Php
if (is_active_sidebar ( ‘footer-sidebar-1’)) {
dynamic_sidebar ( ‘footer-sidebar-1’);
}
?>
</ Div>
<div id = “footer-sidebar2”>
<? Php
if (is_active_sidebar ( ‘footer-sidebar-2’)) {
dynamic_sidebar ( ‘footer-sidebar-2’);
}
?>
</ Div>
<div id = “footer-sidebar3”>
<? Php
if (is_active_sidebar ( ‘footer-sidebar-3’)) {
dynamic_sidebar ( ‘footer-sidebar-3’);
}
?>
</ Div>
<div id = “footer-sidebar4”>
<? Php
if (is_active_sidebar ( ‘footer-sidebar-4’)) {
dynamic_sidebar ( ‘footer-sidebar-4’);
}
?>
</ Div>
</ Div>I have not made any changes to the “style.css” because the default values ??should already be given. Basically it works already and I see the new sidebars under “Design> Widgets” and fill them with widgets. I’ve tested each with a calendar and a search box widget, but it breaks me the whole footer as everything is stretched to 100% of the screen. Maybe someone could help me and look at it.
- The topic ‘Additional Sidebars Problem’ is closed to new replies.