aboutsummaryrefslogtreecommitdiff
path: root/srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-07 13:06:14 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-07 13:06:14 +0100
commit7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 (patch)
treef7453d7dd5cbaaab246e23810b02d3edf1e451be /srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php
parentc59bdcf77c50cbe89b4a93782cdd6d9e7532080e (diff)
downloadft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.tar.gz
ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.tar.bz2
ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.zip
Added wordpress
Diffstat (limited to 'srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php')
-rw-r--r--srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php119
1 files changed, 119 insertions, 0 deletions
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php b/srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php
new file mode 100644
index 0000000..fe89d64
--- /dev/null
+++ b/srcs/wordpress/wp-content/themes/twentytwenty/template-parts/footer-menus-widgets.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Displays the menus and widgets at the end of the main element.
+ * Visually, this output is presented as part of the footer element.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Twenty
+ * @since 1.0.0
+ */
+
+$has_footer_menu = has_nav_menu( 'footer' );
+$has_social_menu = has_nav_menu( 'social' );
+
+$has_sidebar_1 = is_active_sidebar( 'sidebar-1' );
+$has_sidebar_2 = is_active_sidebar( 'sidebar-2' );
+
+// Only output the container if there are elements to display.
+if ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {
+ ?>
+
+ <div class="footer-nav-widgets-wrapper header-footer-group">
+
+ <div class="footer-inner section-inner">
+
+ <?php
+
+ $footer_top_classes = '';
+
+ $footer_top_classes .= $has_footer_menu ? ' has-footer-menu' : '';
+ $footer_top_classes .= $has_social_menu ? ' has-social-menu' : '';
+
+ if ( $has_footer_menu || $has_social_menu ) {
+ ?>
+ <div class="footer-top<?php echo $footer_top_classes; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
+ <?php if ( $has_footer_menu ) { ?>
+
+ <nav aria-label="<?php esc_attr_e( 'Footer', 'twentytwenty' ); ?>" role="navigation" class="footer-menu-wrapper">
+
+ <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 ) { ?>
+
+ <nav aria-label="<?php esc_attr_e( 'Social links', 'twentytwenty' ); ?>" class="footer-social-wrapper">
+
+ <ul class="social-menu footer-social reset-list-style social-icons fill-children-current-color">
+
+ <?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><!-- .footer-social -->
+
+ </nav><!-- .footer-social-wrapper -->
+
+ <?php } ?>
+ </div><!-- .footer-top -->
+
+ <?php } ?>
+
+ <?php if ( $has_sidebar_1 || $has_sidebar_2 ) { ?>
+
+ <aside class="footer-widgets-outer-wrapper" role="complementary">
+
+ <div class="footer-widgets-wrapper">
+
+ <?php if ( $has_sidebar_1 ) { ?>
+
+ <div class="footer-widgets column-one grid-item">
+ <?php dynamic_sidebar( 'sidebar-1' ); ?>
+ </div>
+
+ <?php } ?>
+
+ <?php if ( $has_sidebar_2 ) { ?>
+
+ <div class="footer-widgets column-two grid-item">
+ <?php dynamic_sidebar( 'sidebar-2' ); ?>
+ </div>
+
+ <?php } ?>
+
+ </div><!-- .footer-widgets-wrapper -->
+
+ </aside><!-- .footer-widgets-outer-wrapper -->
+
+ <?php } ?>
+
+ </div><!-- .footer-inner -->
+
+ </div><!-- .footer-nav-widgets-wrapper -->
+
+<?php } ?>