angelovcom.net

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

footer-menus-widgets.php (3180B)


      1 <?php
      2 /**
      3  * Displays the menus and widgets at the end of the main element.
      4  * Visually, this output is presented as part of the footer element.
      5  *
      6  * @package WordPress
      7  * @subpackage Twenty_Twenty
      8  * @since Twenty Twenty 1.0
      9  */
     10 
     11 $has_footer_menu = has_nav_menu( 'footer' );
     12 $has_social_menu = has_nav_menu( 'social' );
     13 
     14 $has_sidebar_1 = is_active_sidebar( 'sidebar-1' );
     15 $has_sidebar_2 = is_active_sidebar( 'sidebar-2' );
     16 
     17 // Only output the container if there are elements to display.
     18 if ( $has_footer_menu || $has_social_menu || $has_sidebar_1 || $has_sidebar_2 ) {
     19 	?>
     20 
     21 	<div class="footer-nav-widgets-wrapper header-footer-group">
     22 
     23 		<div class="footer-inner section-inner">
     24 
     25 			<?php
     26 
     27 			$footer_top_classes = '';
     28 
     29 			$footer_top_classes .= $has_footer_menu ? ' has-footer-menu' : '';
     30 			$footer_top_classes .= $has_social_menu ? ' has-social-menu' : '';
     31 
     32 			if ( $has_footer_menu || $has_social_menu ) {
     33 				?>
     34 				<div class="footer-top<?php echo $footer_top_classes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- static output ?>">
     35 					<?php if ( $has_footer_menu ) { ?>
     36 
     37 						<nav aria-label="<?php esc_attr_e( 'Footer', 'twentytwenty' ); ?>" role="navigation" class="footer-menu-wrapper">
     38 
     39 							<ul class="footer-menu reset-list-style">
     40 								<?php
     41 								wp_nav_menu(
     42 									array(
     43 										'container'      => '',
     44 										'depth'          => 1,
     45 										'items_wrap'     => '%3$s',
     46 										'theme_location' => 'footer',
     47 									)
     48 								);
     49 								?>
     50 							</ul>
     51 
     52 						</nav><!-- .site-nav -->
     53 
     54 					<?php } ?>
     55 					<?php if ( $has_social_menu ) { ?>
     56 
     57 						<nav aria-label="<?php esc_attr_e( 'Social links', 'twentytwenty' ); ?>" class="footer-social-wrapper">
     58 
     59 							<ul class="social-menu footer-social reset-list-style social-icons fill-children-current-color">
     60 
     61 								<?php
     62 								wp_nav_menu(
     63 									array(
     64 										'theme_location'  => 'social',
     65 										'container'       => '',
     66 										'container_class' => '',
     67 										'items_wrap'      => '%3$s',
     68 										'menu_id'         => '',
     69 										'menu_class'      => '',
     70 										'depth'           => 1,
     71 										'link_before'     => '<span class="screen-reader-text">',
     72 										'link_after'      => '</span>',
     73 										'fallback_cb'     => '',
     74 									)
     75 								);
     76 								?>
     77 
     78 							</ul><!-- .footer-social -->
     79 
     80 						</nav><!-- .footer-social-wrapper -->
     81 
     82 					<?php } ?>
     83 				</div><!-- .footer-top -->
     84 
     85 			<?php } ?>
     86 
     87 			<?php if ( $has_sidebar_1 || $has_sidebar_2 ) { ?>
     88 
     89 				<aside class="footer-widgets-outer-wrapper" role="complementary">
     90 
     91 					<div class="footer-widgets-wrapper">
     92 
     93 						<?php if ( $has_sidebar_1 ) { ?>
     94 
     95 							<div class="footer-widgets column-one grid-item">
     96 								<?php dynamic_sidebar( 'sidebar-1' ); ?>
     97 							</div>
     98 
     99 						<?php } ?>
    100 
    101 						<?php if ( $has_sidebar_2 ) { ?>
    102 
    103 							<div class="footer-widgets column-two grid-item">
    104 								<?php dynamic_sidebar( 'sidebar-2' ); ?>
    105 							</div>
    106 
    107 						<?php } ?>
    108 
    109 					</div><!-- .footer-widgets-wrapper -->
    110 
    111 				</aside><!-- .footer-widgets-outer-wrapper -->
    112 
    113 			<?php } ?>
    114 
    115 		</div><!-- .footer-inner -->
    116 
    117 	</div><!-- .footer-nav-widgets-wrapper -->
    118 
    119 <?php } ?>