• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Files / template-parts/footer-menus-widgets.php


Lines:

1 to 100 of 122
<?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 Twenty Twenty 1.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' ); ?>" 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">

					<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 } ?>

[1] [2] Next »

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      Call hooks

      File name: template-parts/footer-menus-widgets.php
      Plugin ref: Twenty Twenty
      Version: 2.1
      Deprecated?: No
      API Letters: F,M,P,T,W

      Published: 25th November 2019 | Last updated: 2nd November 2022

      Primary Sidebar

      Information

      File name: template-parts/footer-menus-widgets.php
      Plugin ref: Twenty Twenty
      Version: 2.1
      Deprecated?: No
      API Letters: F,M,P,T,W

      template-parts

      Footer

      WordPress a2z
      WordPress a2z
      WordPress Dynamic API Reference
      WordPress 6.1.1. PHP: 8.0.28
      WordPress a2z
      WordPress core a2z
      Genesis Theme Framework a2z
      Jetpack a2z
      WordPress develop tests
      Easy Digital Downloads a2z
      WooCommerce a2z
      Yoast SEO a2z
      WordPress Blocks

      Site:  wp-a2z.org
      © Copyright WordPress a2z 2014-2023. All rights reserved.


      Website designed and developed by Herb Miller
      Proudly powered by WordPress and oik plugins

      • Home
      • Blog
      • Sitemap
      • Sites