People, I have to tell you that nikeo’s code is a dream to work with. I’m not a programmer, but his code is so logical, I can work out swathes of it.
He gives us a filter for the footer widget array and he gives us another for the widget classes.
This means that the following works in a child theme’s functions.php. To find out how to use a child theme’s functions.php, see here
. That article shows you how to place this code in the right place.
// Add an extra widget in the footer. It gets registered automatically as part of the array
add_filter( 'tc_footer_widgets', 'my_footer_widgets');
function my_footer_widgets() {
return array(
'footer_one' => array(
'name' => __( 'Footer Widget Area One' , 'customizr' ),
'description' => __( 'Just use it as you want !' , 'customizr' )
),
'footer_two' => array(
'name' => __( 'Footer Widget Area Two' , 'customizr' ),
'description' => __( 'Just use it as you want !' , 'customizr' )
),
'footer_three' => array(
'name' => __( 'Footer Widget Area Three' , 'customizr' ),
'description' => __( 'Just use it as you want !' , 'customizr' )
),
'footer_four' => array(
'name' => __( 'Footer Widget Area Four' , 'customizr' ),
'description' => __( 'Just use it as you want !' , 'customizr' )
)
);
}
// Now style all the footer widgets so they take up the right space
add_filter( 'footer_one_widget_class', 'my_footer_one_widget_class');
function my_footer_one_widget_class() {
return 'span3';
}
add_filter( 'footer_two_widget_class', 'my_footer_two_widget_class');
function my_footer_two_widget_class() {
return 'span3';
}
add_filter( 'footer_three_widget_class', 'my_footer_three_widget_class');
function my_footer_three_widget_class() {
return 'span3';
}
add_filter( 'footer_four_widget_class', 'my_footer_four_widget_class');
function my_footer_four_widget_class() {
return 'span3';
}
I feel another snippet coming on….