Skip to content

Commit b9dc8a0

Browse files
Added footer, footer widget classes using customizer
1 parent 32103b7 commit b9dc8a0

File tree

2 files changed

+65
-4
lines changed

2 files changed

+65
-4
lines changed

lib/bootstrap.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ function bfg_merge_genesis_attr_classes() {
6969
'entry-content' => 'clearfix',
7070
'entry-pagination' => 'clearfix',
7171
'structural-wrap' => 'container',
72-
'footer-widget-area' => 'col-sm-6',
7372
'comment-list' => 'list-unstyled',
7473
'home-featured' => 'jumbotron',
75-
// 'site-header' => 'navbar navbar-expand-lg navbar-dark bg-dark',
7674
'entry-image' => 'img-fluid'
7775
);
7876

@@ -106,6 +104,32 @@ function bfg_merge_genesis_attr_classes() {
106104
}
107105

108106
$classes['site-header'] = esc_attr( implode( ' ', $navclasses ) );
107+
108+
// Footer Class
109+
$footerwidgetbg = get_theme_mod( 'footer-widget-bg', 'dark' );
110+
111+
$footerwidgetclasses = array();
112+
113+
if ( $footerwidgetbg !== 'primary' ) {
114+
$footerwidgetclasses[] = 'text-muted';
115+
}
116+
117+
$footerwidgetclasses[] = 'bg-' . $footerwidgetbg;
118+
119+
$classes['footer-widgets'] = esc_attr( implode( ' ', $footerwidgetclasses ) );
120+
121+
// Footer Class
122+
$footerbg = get_theme_mod( 'footerbg', 'dark' );
123+
124+
$footerclasses = array();
125+
126+
if ( $footerbg !== 'primary' ) {
127+
$footerclasses[] = 'text-muted';
128+
}
129+
130+
$footerclasses[] = 'bg-' . $footerbg;
131+
132+
$classes['site-footer'] = esc_attr( implode( ' ', $footerclasses ) );
109133

110134
if ( has_filter( 'bfg_add_classes' ) ) {
111135
$classes = apply_filters( 'bfg_add_classes', $classes );

lib/kirki.php

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,55 @@
9494
)
9595
) );
9696

97+
// Footer Widget Section
98+
BFG_Kirki::add_section( 'footer-widget', array(
99+
'title' => __( 'Footer Widget', 'bootstrap-for-genesis' ),
100+
'priority' => '4',
101+
'capability' => 'edit_theme_options'
102+
) );
103+
104+
BFG_Kirki::add_field( 'bootstrap-for-genesis', array(
105+
'type' => 'select',
106+
'settings' => 'footer-widget-bg',
107+
'section' => 'footer-widget',
108+
'label' => __( 'Footer Widget Background', 'bootstrap-for-genesis' ),
109+
'description' => __( '', 'bootstrap-for-genesis' ),
110+
'priority' => 15,
111+
'choices' => array(
112+
'light' => __( 'Light', 'bootstrap-for-genesis' ),
113+
'dark' => __( 'Dark', 'bootstrap-for-genesis' ),
114+
'primary' => __( 'Primary', 'bootstrap-for-genesis' )
115+
),
116+
'default' => 'dark'
117+
) );
118+
97119
// Footer Section
98120
BFG_Kirki::add_section( 'footer', array(
99121
'title' => __( 'Footer', 'bootstrap-for-genesis' ),
100-
'priority' => '4',
122+
'priority' => '5',
101123
'capability' => 'edit_theme_options'
102124
) );
103125

126+
BFG_Kirki::add_field( 'bootstrap-for-genesis', array(
127+
'type' => 'select',
128+
'settings' => 'footerbg',
129+
'section' => 'footer',
130+
'label' => __( 'Footer Background', 'bootstrap-for-genesis' ),
131+
'description' => __( '', 'bootstrap-for-genesis' ),
132+
'priority' => 15,
133+
'choices' => array(
134+
'light' => __( 'Light', 'bootstrap-for-genesis' ),
135+
'dark' => __( 'Dark', 'bootstrap-for-genesis' ),
136+
'primary' => __( 'Primary', 'bootstrap-for-genesis' )
137+
),
138+
'default' => 'dark'
139+
) );
140+
104141
BFG_Kirki::add_field( 'bootstrap-for-genesis', array(
105142
'type' => 'textarea',
106143
'settings' => 'creds',
107144
'label' => __( 'Footer Credits', 'bootstrap-for-genesis' ),
108145
'section' => 'footer',
109146
'default' => '',
110-
'priority' => 10
147+
'priority' => 20
111148
) );

0 commit comments

Comments
 (0)