@@ -23,40 +23,16 @@ public function render_footer() { ?>
23
23
<footer>
24
24
<div class="container">
25
25
<?php echo $ this ->render_footer_sidebars (); ?>
26
+ <?php echo $ this ->render_footer_content (); ?>
26
27
</div>
27
28
</footer>
28
29
<?php }
29
30
30
- /**
31
- * Get an array of footer sidebars slugs.
32
- *
33
- * @return array
34
- */
35
- private function get_footer_sidebars () {
36
- $ sidebars = array (
37
- 'footer-one-widgets ' ,
38
- 'footer-two-widgets ' ,
39
- 'footer-three-widgets ' ,
40
- 'footer-four-widgets ' ,
41
- );
42
- $ number_of_sidebars = $ this ->footer_sidebars_number ();
43
- $ sidebars = array_slice ( $ sidebars , 0 , $ number_of_sidebars );
44
-
45
- return $ sidebars ;
46
- }
47
-
48
- private function footer_sidebars_number () {
49
- return get_theme_mod ( 'neve_footer_widget_columns ' , '3 ' );
50
- }
51
-
52
31
/**
53
32
* Render the footer sidebars.
54
33
*/
55
34
private function render_footer_sidebars () {
56
35
$ sidebars = $ this ->get_footer_sidebars ();
57
- if ( empty ( $ sidebars ) ) {
58
- return '' ;
59
- }
60
36
61
37
echo '<div class="row nv-footer-widgets"> ' ;
62
38
foreach ( $ sidebars as $ sidebar ) {
@@ -68,78 +44,43 @@ private function render_footer_sidebars() {
68
44
}
69
45
70
46
/**
71
- * Function to display footer content.
72
- *
73
- * @since 1.1.24
74
- * @access public
47
+ * Render the footer content.
75
48
*/
76
- public function the_footer_content () {
77
- hestia_before_footer_trigger ();
78
-
79
- ?>
80
- <footer class="footer <?php echo esc_attr ( $ this ->the_footer_class () ); ?> footer-big">
81
- <?php hestia_before_footer_content_trigger (); ?>
82
- <div class="container">
83
- <?php hestia_before_footer_widgets_trigger (); ?>
84
- <?php $ this ->render_footer_sidebars (); ?>
85
- <?php hestia_after_footer_widgets_trigger (); ?>
86
- <?php $ this ->wrapped_bottom_footer_content (); ?>
87
- </div>
88
- <?php hestia_after_footer_content_trigger (); ?>
89
- </footer>
90
- <?php
91
- hestia_after_footer_trigger ();
92
- }
93
-
94
- /**
95
- * Filter footer menu classes to account for alignment.
96
- *
97
- * @param string $classes the footer classes.
98
- *
99
- * @return mixed
100
- */
101
- public function modify_footer_menu_classes ( $ classes ) {
102
- if ( 'footer ' !== $ classes ['theme_location ' ] ) {
103
- return $ classes ;
49
+ public function render_footer_content () {
50
+ $ content_type = get_theme_mod ( 'neve_footer_content_type ' , 'text ' );
51
+ if ( $ content_type === 'none ' ) {
52
+ return ;
104
53
}
105
- $ classes ['menu_class ' ] .= ' ' . $ this ->add_footer_menu_alignment_class ();
106
54
107
- return $ classes ;
108
- }
55
+ echo '<div class="row nv-footer-content"> ' ;
56
+ echo '<div class="col-12"> ' ;
57
+
58
+ switch ( $ content_type ) {
59
+ case 'text ' :
60
+ $ this ->render_content_text ();
61
+ break ;
62
+ case 'footer_menu ' :
63
+ $ this ->render_content_menu ();
64
+ break ;
65
+ default :
66
+ }
109
67
110
- /**
111
- * Function to display footer copyright and footer menu.
112
- */
113
- private function wrapped_bottom_footer_content () {
114
- echo '<div class="hestia-bottom-footer-content"> ' ;
115
- do_action ( 'hestia_do_bottom_footer_content ' );
68
+ echo '</div> ' ;
116
69
echo '</div> ' ;
117
70
}
118
71
119
- /**
120
- * Function to display footer copyright and footer menu.
121
- * Also used as callback for selective refresh.
122
- */
123
- public function bottom_footer_content () {
124
- $ hestia_general_credits = get_theme_mod (
125
- 'hestia_general_credits ' ,
126
- sprintf (
127
- /* translators: %1$s is Theme Name, %2$s is WordPress */
128
- esc_html__ ( '%1$s | Powered by %2$s ' , 'hestia-pro ' ),
129
- sprintf (
130
- /* translators: %s is Theme name */
131
- '<a href="https://themeisle.com/themes/hestia/" target="_blank" rel="nofollow">%s</a> ' ,
132
- esc_html__ ( 'Hestia ' , 'hestia-pro ' )
133
- ),
134
- /* translators: %1$s is URL, %2$s is WordPress */
135
- sprintf (
136
- '<a href="%1$s" rel="nofollow">%2$s</a> ' ,
137
- esc_url ( __ ( 'http://wordpress.org ' , 'hestia-pro ' ) ),
138
- esc_html__ ( 'WordPress ' , 'hestia-pro ' )
139
- )
140
- )
141
- );
72
+ private function render_content_text () {
73
+ $ content = get_theme_mod ( 'neve_footer_text ' , sprintf (
74
+ /* translators: %1$s is Theme Name (Neve), %2$s is WordPress */
75
+ esc_html__ ( '%1$s | Powered by %2$s ' , 'neve ' ),
76
+ wp_kses_post ( '<a href="https://themeisle.com/themes/neve/" target="_blank" rel="nofollow">Neve</a> ' ),
77
+ wp_kses_post ( '<a href="http://wordpress.org" rel="nofollow">WordPress</a> ' )
78
+ ) );
142
79
80
+ echo wp_kses_post ( $ content );
81
+ }
82
+
83
+ private function render_content_menu () {
143
84
wp_nav_menu (
144
85
array (
145
86
'theme_location ' => 'footer ' ,
@@ -148,61 +89,33 @@ public function bottom_footer_content() {
148
89
'menu_class ' => 'footer-menu ' ,
149
90
)
150
91
);
151
- ?>
152
- <?php if ( ! empty ( $ hestia_general_credits ) || is_customize_preview () ) : ?>
153
- <div class="copyright <?php echo esc_attr ( $ this ->add_footer_copyright_alignment_class () ); ?> ">
154
- <?php echo wp_kses_post ( $ hestia_general_credits ); ?>
155
- </div>
156
- <?php
157
- endif ;
158
92
}
159
93
160
94
/**
161
- * Add the footer copyright alignment class .
95
+ * Get an array of footer sidebars slugs .
162
96
*
163
- * @return string
97
+ * @return array
164
98
*/
165
- private function add_footer_copyright_alignment_class () {
166
- $ hestia_copyright_alignment = get_theme_mod ( 'hestia_copyright_alignment ' , 'right ' );
167
- if ( $ hestia_copyright_alignment === 'left ' ) {
168
- return 'pull-left ' ;
169
- }
170
- if ( $ hestia_copyright_alignment === 'center ' ) {
171
- return 'hestia-center ' ;
172
- }
99
+ private function get_footer_sidebars () {
100
+ $ sidebars = array (
101
+ 'footer-one-widgets ' ,
102
+ 'footer-two-widgets ' ,
103
+ 'footer-three-widgets ' ,
104
+ 'footer-four-widgets ' ,
105
+ );
106
+ $ number_of_sidebars = $ this ->footer_sidebars_number ();
107
+ $ sidebars = array_slice ( $ sidebars , 0 , $ number_of_sidebars );
173
108
174
- return ' pull-right ' ;
109
+ return $ sidebars ;
175
110
}
176
111
177
112
/**
178
- * Add the footer menu alignment class .
113
+ * Get number of footer sidebars .
179
114
*
180
115
* @return string
181
116
*/
182
- private function add_footer_menu_alignment_class () {
183
- $ hestia_copyright_alignment = get_theme_mod ( 'hestia_copyright_alignment ' , 'right ' );
184
- if ( $ hestia_copyright_alignment === 'left ' ) {
185
- return 'pull-right ' ;
186
- }
187
- if ( $ hestia_copyright_alignment === 'center ' ) {
188
- return 'hestia-center ' ;
189
- }
190
-
191
- return 'pull-left ' ;
192
- }
193
-
194
- /**
195
- * Utility to get the footer class for color changes.
196
- */
197
- private function the_footer_class () {
198
- $ footer_style = get_theme_mod ( 'hestia_alternative_footer_style ' , 'black_footer ' );
199
- $ class = 'footer-black ' ;
200
-
201
- if ( $ footer_style === 'white_footer ' ) {
202
- $ class = '' ;
203
- }
204
-
205
- return $ class ;
117
+ private function footer_sidebars_number () {
118
+ return get_theme_mod ( 'neve_footer_widget_columns ' , '3 ' );
206
119
}
207
120
208
121
/**
@@ -222,26 +135,4 @@ private function the_sidebar_class() {
222
135
223
136
return $ class ;
224
137
}
225
-
226
- /**
227
- * Utility to check if any of the footer sidebars have widgets.
228
- *
229
- * @return bool
230
- */
231
- private function footer_has_widgets () {
232
- $ sidebars = $ this ->get_footer_sidebars ();
233
- if ( empty ( $ sidebars ) ) {
234
- return false ;
235
- }
236
-
237
- foreach ( $ sidebars as $ footer_sidebar ) {
238
- $ has_widgets = is_active_sidebar ( $ footer_sidebar );
239
- if ( $ has_widgets ) {
240
- return true ;
241
- }
242
- }
243
-
244
- return false ;
245
- }
246
-
247
138
}
0 commit comments