浏览代码

social navigation template part

Maggie Cabrera 4 年之前
父节点
当前提交
4229d4603b

+ 2 - 30
balasana/template-parts/footer/footer-content.php

@@ -9,37 +9,9 @@
 			if ( has_nav_menu( 'menu-2' ) || has_nav_menu( 'social' ) ) : ?>
 				<div class="footer-menus">
 
-					<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
-						<nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Footer Menu', 'balasana' ); ?>">
-							<?php
-							wp_nav_menu(
-								array(
-									'theme_location' => 'menu-2',
-									'menu_class'     => 'footer-menu',
-									'depth'          => 1,
-								)
-							);
-							?>
-						</nav><!-- .footer-navigation -->
-						<?php
-					endif;
+					<?php get_template_part( 'template-parts/footer/footer', 'navigation' );
 
-					if ( has_nav_menu( 'social' ) ) :
-						?>
-						<nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'balasana' ); ?>">
-							<?php
-							wp_nav_menu(
-								array(
-									'theme_location' => 'social',
-									'menu_class'     => 'social-links-menu',
-									'link_before'    => '<span class="screen-reader-text">',
-									'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-									'depth'          => 1,
-								)
-							);
-							?>
-						</nav><!-- .social-navigation -->
-					<?php endif; ?>
+					get_template_part( 'template-parts/header/social', 'navigation' ); ?>
 
 				</div><!-- .footer-menus -->
 				<?php

+ 1 - 15
coutoire/header.php

@@ -56,21 +56,7 @@
 				</nav><!-- #site-navigation -->
 			<?php endif; ?>
 
-			<?php if ( has_nav_menu( 'social' ) ) : ?>
-				<nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
-					<?php
-					wp_nav_menu(
-						array(
-							'theme_location' => 'social',
-							'menu_class'     => 'social-links-menu',
-							'link_before'    => '<span class="screen-reader-text">',
-							'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-							'depth'          => 1,
-						)
-					);
-					?>
-				</nav><!-- .social-navigation -->
-			<?php endif; ?>
+			<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
 
 		</header><!-- #masthead -->
 

+ 1 - 15
dalston/header.php

@@ -74,21 +74,7 @@ $header_classes .= $has_primary_nav ? ' has-menu' : '';
 				</nav><!-- #site-navigation -->
 			<?php endif; ?>
 
-			<?php if ( has_nav_menu( 'social' ) ) : ?>
-				<nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
-					<?php
-					wp_nav_menu(
-						array(
-							'theme_location' => 'social',
-							'menu_class'     => 'social-links-menu',
-							'link_before'    => '<span class="screen-reader-text">',
-							'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-							'depth'          => 1,
-						)
-					);
-					?>
-				</nav><!-- .social-navigation -->
-			<?php endif; ?>
+			<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
 
 		</header><!-- #masthead -->
 

+ 1 - 15
morden/header.php

@@ -75,21 +75,7 @@ if ( function_exists( 'wp_body_open' ) ) {
 					</nav><!-- #site-navigation -->
 				<?php endif; ?>
 
-				<?php if ( has_nav_menu( 'social' ) ) : ?>
-					<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
-						<?php
-						wp_nav_menu(
-							array(
-								'theme_location' => 'social',
-								'menu_class'     => 'social-links-menu',
-								'link_before'    => '<span class="screen-reader-text">',
-								'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-								'depth'          => 1,
-							)
-						);
-						?>
-					</nav><!-- .social-navigation -->
-				<?php endif; ?>
+				<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
 
 			</div><!-- .site-header-wrap -->
 

+ 1 - 16
rivington/template-parts/footer/footer-content.php

@@ -8,22 +8,7 @@
 
 			get_template_part( 'template-parts/footer/privacy-policy', '' );
 
-			if ( has_nav_menu( 'social' ) ) : ?>
-				<nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'rockfield' ); ?>">
-					<?php
-					wp_nav_menu(
-						array(
-							'theme_location' => 'social',
-							'menu_class'     => 'social-links-menu',
-							'link_before'    => '<span class="screen-reader-text">',
-							'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-							'depth'          => 1,
-						)
-					);
-					?>
-				</nav><!-- .social-navigation -->
-				<?php
-			endif;
+			get_template_part( 'template-parts/header/social', 'navigation' ); 
 		endif;
 		?>
 

+ 1 - 15
rockfield/template-parts/footer/footer-content.php

@@ -1,21 +1,7 @@
 <footer id="colophon" class="site-footer">
 	<?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?>
 	<?php get_template_part( 'template-parts/footer/privacy-policy', '' ); ?>
-<?php if ( has_nav_menu( 'social' ) ) : ?>
-	<nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'rockfield' ); ?>">
-	<?php
-	wp_nav_menu(
-		array(
-			'theme_location' => 'social',
-			'menu_class'     => 'social-links-menu',
-			'link_before'    => '<span class="screen-reader-text">',
-			'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-			'depth'          => 1,
-		)
-	);
-	?>
-	</nav><!-- .social-navigation -->
-<?php endif; ?>
+	<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
 
 	<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
 		<nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Footer Menu', 'rockfield' ); ?>">

+ 1 - 15
stow/header.php

@@ -67,21 +67,7 @@
 				</nav><!-- #site-navigation -->
 			<?php endif; ?>
 
-			<?php if ( has_nav_menu( 'social' ) ) : ?>
-				<nav class="social-navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
-					<?php
-					wp_nav_menu(
-						array(
-							'theme_location' => 'social',
-							'menu_class'     => 'social-links-menu',
-							'link_before'    => '<span class="screen-reader-text">',
-							'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-							'depth'          => 1,
-						)
-					);
-					?>
-				</nav><!-- .social-navigation -->
-			<?php endif; ?>
+			<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>
 
 		</header><!-- #masthead -->
 

+ 1 - 15
varia/template-parts/header/site-navigation.php

@@ -35,18 +35,4 @@
 	</nav><!-- #site-navigation -->
 <?php endif; ?>
 
-<?php if ( has_nav_menu( 'social' ) ) : ?>
-	<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
-		<?php
-		wp_nav_menu(
-			array(
-				'theme_location' => 'social',
-				'menu_class'     => 'social-links-menu',
-				'link_before'    => '<span class="screen-reader-text">',
-				'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
-				'depth'          => 1,
-			)
-		);
-		?>
-	</nav><!-- .social-navigation -->
-<?php endif; ?>
+<?php get_template_part( 'template-parts/header/social', 'navigation' ); ?>

+ 15 - 0
varia/template-parts/header/social-navigation.php

@@ -0,0 +1,15 @@
+<?php if ( has_nav_menu( 'social' ) ) : ?>
+	<nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Social Links Menu', 'varia' ); ?>">
+		<?php
+		wp_nav_menu(
+			array(
+				'theme_location' => 'social',
+				'menu_class'     => 'social-links-menu',
+				'link_before'    => '<span class="screen-reader-text">',
+				'link_after'     => '</span>' . varia_get_icon_svg( 'link' ),
+				'depth'          => 1,
+			)
+		);
+		?>
+	</nav><!-- .social-navigation -->
+<?php endif; ?>