forked from WordPress/twentytwenty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.php
169 lines (123 loc) · 4.56 KB
/
footer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/**
* The template for displaying the footer
*
* Contains the opening of the #site-footer div and all content after.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Twenty
* @since 1.0.0
*/
?>
<footer id="site-footer" role="contentinfo">
<div class="footer-inner section-inner">
<?php
$has_footer_menu = has_nav_menu( 'footer' );
$has_social_menu = has_nav_menu( 'social' );
$footer_top_classes = '';
$footer_top_classes .= $has_footer_menu ? ' has-footer-menu' : '';
$footer_top_classes .= $has_social_menu ? ' has-social-menu' : '';
$footer_social_wrapper_class = $has_footer_menu ? 'footer-social-wrapper' : '';
if ( $has_footer_menu || $has_social_menu ) {
?>
<div class="footer-top<?php echo esc_attr( $footer_top_classes ); ?>">
<?php if ( $has_footer_menu ) { ?>
<nav aria-label="<?php esc_attr_e( 'Footer menu', 'twentytwenty' ); ?>">
<ul class="footer-menu reset-list-style">
<?php
wp_nav_menu(
array(
'container' => '',
'depth' => 1,
'items_wrap' => '%3$s',
'theme_location' => 'footer',
)
);
?>
</ul>
</nav><!-- .site-nav -->
<?php } ?>
<?php if ( $has_social_menu ) { ?>
<div class="<?php esc_attr( $footer_social_wrapper_class ); ?>">
<nav aria-label="<?php esc_attr_e( 'Social links', 'twentytwenty' ); ?>">
<ul class="social-menu footer-social reset-list-style social-icons s-icons">
<?php
wp_nav_menu(
array(
'theme_location' => 'social',
'container' => '',
'container_class' => '',
'items_wrap' => '%3$s',
'menu_id' => '',
'menu_class' => '',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
'fallback_cb' => '',
)
);
?>
</ul>
</nav><!-- .social-menu -->
</div><!-- .footer-social-wrapper -->
<?php } ?>
</div><!-- .footer-top -->
<?php } ?>
<?php if ( is_active_sidebar( 'footer-one' ) || is_active_sidebar( 'footer-two' ) ) { ?>
<div class="footer-widgets-outer-wrapper">
<div class="footer-widgets-wrapper">
<?php if ( is_active_sidebar( 'footer-one' ) ) { ?>
<div class="footer-widgets column-one grid-item">
<?php dynamic_sidebar( 'footer-one' ); ?>
</div>
<?php } ?>
<?php if ( is_active_sidebar( 'footer-two' ) ) { ?>
<div class="footer-widgets column-two grid-item">
<?php dynamic_sidebar( 'footer-two' ); ?>
</div>
<?php } ?>
</div><!-- .footer-widgets-wrapper -->
</div><!-- .footer-widgets-outer-wrapper -->
<?php } ?>
<div class="footer-bottom">
<div class="footer-credits">
<p class="footer-copyright">©
<?php
echo esc_html(
date_i18n(
/* Translators: Y = Format parameter for date() https://php.net/manual/en/function.date.php */
_x( 'Y', 'Translators: Y = Current year', 'twentytwenty' )
)
);
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo bloginfo( 'name' ); ?></a></a>
</p>
<p class="powered-by-wordpress">
<?php
/* Translators: %s = Link to WordPress.org */
printf( _x( 'Powered by %s', 'Translators: %s = Link to WordPress.org', 'twentytwenty' ), '<a href="https://wordpress.org">' . __( 'WordPress', 'twentytwenty' ) . '</a>' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- core trusts translations
?>
</p><!-- .theme-credits -->
</div><!-- .footer-credits -->
<a class="to-the-top" href="#site-header">
<span class="to-the-top-long">
<?php
// Translators: %s = HTML character for an arrow.
printf( esc_html( _x( 'To the top %s', '%s = HTML character for an arrow', 'twentytwenty' ) ), '<span class="arrow">↑</span>' );
?>
</span>
<span class="to-the-top-short">
<?php
// Translators: %s = HTML character for an arrow.
printf( esc_html( _x( 'Up %s', '%s = HTML character for an arrow', 'twentytwenty' ) ), '<span class="arrow">↑</span>' );
?>
</span>
</a>
</div><!-- .footer-bottom -->
</div><!-- .footer-inner -->
</footer><!-- #site-footer -->
<?php wp_footer(); ?>
</body>
</html>