Ver código fonte

footer info template part and Alves footer fix

Maggie Cabrera 4 anos atrás
pai
commit
2e52a5e491

+ 10 - 29
alves/footer.php

@@ -22,43 +22,24 @@
 		$template->output_template_content( A8C\FSE\WP_Template::FOOTER );
 		$template->output_template_content( A8C\FSE\WP_Template::FOOTER );
 	else : // Otherwise we'll fallback to the default Varia footer below. ?>
 	else : // Otherwise we'll fallback to the default Varia footer below. ?>
 	<footer id="colophon" class="site-footer">
 	<footer id="colophon" class="site-footer">
-		<?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?>
+		<?php 
+		if ( ! ( true === get_theme_mod( 'hide_site_footer', false ) && is_front_page() && is_page() ) ) : // If this is the homepage and the footer elements are set to hide, don't load this part.
+			get_template_part( 'template-parts/footer/footer', 'widgets' ); 
+		endif; ?>
 
 
 		<div id="footer-info-wrapper">
 		<div id="footer-info-wrapper">
 
 
 		<?php
 		<?php
+		if ( ! ( true === get_theme_mod( 'hide_site_footer', false ) && is_front_page() && is_page() ) ) : // If this is the homepage and the footer elements are set to hide, don't load this part.
 			if ( function_exists( 'the_privacy_policy_link' ) ) {
 			if ( function_exists( 'the_privacy_policy_link' ) ) {
 				the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' );
 				the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' );
 			}
 			}
-		?>
-		<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
-			<nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Footer Menu', 'alves' ); ?>">
-				<?php
-				wp_nav_menu(
-					array(
-						'theme_location' => 'menu-2',
-						'menu_class'     => 'footer-menu',
-						'depth'          => 1,
-					)
-				);
-				?>
-			</nav><!-- .footer-navigation -->
-			<?php endif;
-	endif; ?>
-
-		<div class="site-info">
-				<?php $blog_info = get_bloginfo( 'name' ); ?>
-				<?php if ( ! empty( $blog_info ) ) : ?>
-					<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a><span class="comma">,</span>
-				<?php endif; ?>
-				<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'alves' ) ); ?>" class="imprint">
-					<?php
-					/* translators: %s: WordPress. */
-					printf( __( 'proudly powered by %s.', 'alves' ), 'WordPress' );
-					?>
-				</a>
-			</div><!-- .site-info -->
+			get_template_part( 'template-parts/footer/footer', 'navigation' ); 
+		endif;
+		get_template_part( 'template-parts/footer/footer', 'info' ); ?>
 		</div>
 		</div>
+	<?php endif; ?>
+
 	</footer><!-- #colophon -->
 	</footer><!-- #colophon -->
 
 
 </div><!-- #page -->
 </div><!-- #page -->

+ 12 - 0
alves/template-parts/footer/footer-info.php

@@ -0,0 +1,12 @@
+<div class="site-info">
+	<?php $blog_info = get_bloginfo( 'name' ); ?>
+	<?php if ( ! empty( $blog_info ) ) : ?>
+		<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a><span class="comma">,</span>
+	<?php endif; ?>
+	<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'alves' ) ); ?>" class="imprint">
+		<?php
+		/* translators: %s: WordPress. */
+		printf( __( 'proudly powered by %s.', 'alves' ), 'WordPress' );
+		?>
+	</a>
+</div>

+ 1 - 14
varia/footer.php

@@ -31,20 +31,7 @@
 
 
 		<?php endif; ?>
 		<?php endif; ?>
 
 
-		<div class="site-info">
-			<?php $blog_info = get_bloginfo( 'name' ); ?>
-			<?php if ( ! empty( $blog_info ) ) : ?>
-				<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a><span class="comma">,</span>
-			<?php endif; ?>
-			<?php /* translators: 1: WordPress link, 2: WordPress. */
-			printf( '<a href="%1$s" class="imprint">proudly powered by %2$s</a>.',
-				esc_url( __( 'https://wordpress.org/', 'varia' ) ),
-				'WordPress'
-			); ?>
-			<?php if ( function_exists( 'the_privacy_policy_link' ) ) {
-				the_privacy_policy_link();
-			} ?>
-		</div><!-- .site-info -->
+		<?php get_template_part( 'template-parts/footer/footer', 'info' ); ?>
 	</footer><!-- #colophon -->
 	</footer><!-- #colophon -->
 
 
 </div><!-- #page -->
 </div><!-- #page -->

+ 14 - 0
varia/template-parts/footer/footer-info.php

@@ -0,0 +1,14 @@
+<div class="site-info">
+	<?php $blog_info = get_bloginfo( 'name' ); ?>
+	<?php if ( ! empty( $blog_info ) ) : ?>
+		<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a><span class="comma">,</span>
+	<?php endif; ?>
+	<?php /* translators: 1: WordPress link, 2: WordPress. */
+	printf( '<a href="%1$s" class="imprint">proudly powered by %2$s</a>.',
+		esc_url( __( 'https://wordpress.org/', 'varia' ) ),
+		'WordPress'
+	); ?>
+	<?php if ( function_exists( 'the_privacy_policy_link' ) ) {
+		the_privacy_policy_link();
+	} ?>
+</div><!-- .site-info -->