Minecraft-Modern-Theme/footer.php aktualisiert

This commit is contained in:
2026-01-06 17:18:21 +00:00
parent 5987417f36
commit f315469c41

View File

@@ -1,97 +1,103 @@
<footer id="colophon" class="site-footer">
<div class="container">
<div class="footer-widgets-container">
<div class="footer-widgets">
<?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
<div class="footer-widget"><?php dynamic_sidebar( 'footer-1' ); ?></div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
<div class="footer-widget"><?php dynamic_sidebar( 'footer-2' ); ?></div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
<div class="footer-widget"><?php dynamic_sidebar( 'footer-3' ); ?></div>
<?php endif; ?>
</div>
</div>
<?php if ( has_nav_menu( 'footer' ) ) : ?>
<nav class="footer-navigation">
<?php
wp_nav_menu(
array(
'theme_location' => 'footer',
'menu_class' => 'footer-menu',
'container' => false,
)
);
?>
</nav>
<?php endif; ?>
<div class="site-info">
<?php
// Den Copyright-Text aus dem Customizer holen
$copyright_text = get_theme_mod( 'footer_copyright', '&copy; ' . date('Y') . ' ' . get_bloginfo('name') );
// Prüfen, ob der Credit angezeigt werden soll
if ( get_theme_mod('show_footer_credit', true) ) {
$full_footer_text = $copyright_text . ' | <span class="footer-credit">
<a href="https://m-viper.de" target="_blank" rel="noopener noreferrer"
style="color: inherit; text-decoration: none;">
Minecraft Theme Erstellt von M_Viper 2025
</a>
</span>';
} else {
$full_footer_text = $copyright_text;
}
// Den kompletten Text ausgeben
echo '<p>' . wp_kses_post( $full_footer_text ) . '</p>';
?>
</div>
<!-- NEU: Impressum & Datenschutz Links -->
<div class="footer-legal-links">
<?php
$impressum_url = get_theme_mod('footer_impressum_url');
$datenschutz_url = get_theme_mod('footer_datenschutz_url');
$links = array();
if (!empty($impressum_url)) {
$links[] = '<a href="' . esc_url($impressum_url) . '">Impressum</a>';
}
if (!empty($datenschutz_url)) {
$links[] = '<a href="' . esc_url($datenschutz_url) . '">Datenschutz</a>';
}
// Nur anzeigen, wenn mindestens ein Link vorhanden ist
if (!empty($links)) {
echo implode(' | ', $links);
}
?>
</div>
</div>
<!-- Ovaler Dark / Light Mode Toggle mit Sonne & Mond -->
<button class="theme-toggle" aria-label="Dark/Light Mode umschalten" title="Dark / Light Mode">
<div class="theme-toggle-icons">
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
</svg>
<svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"/>
<line x1="12" y1="1" x2="12" y2="3"/>
<line x1="12" y1="21" x2="12" y2="23"/>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
<line x1="1" y1="12" x2="3" y2="12"/>
<line x1="21" y1="12" x2="23" y2="12"/>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
</svg>
</div>
</button>
</footer>
<?php wp_footer(); ?>
</body>
<footer id="colophon" class="site-footer">
<div class="container">
<!-- 1. OBERER BEREICH: Widgets -->
<div class="footer-widgets">
<?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
<div class="footer-widget"><?php dynamic_sidebar( 'footer-1' ); ?></div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
<div class="footer-widget"><?php dynamic_sidebar( 'footer-2' ); ?></div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
<div class="footer-widget"><?php dynamic_sidebar( 'footer-3' ); ?></div>
<?php endif; ?>
</div>
<!-- 2. UNTERER BEREICH: Menü, Copyright, Legal -->
<div class="footer-bottom-bar">
<div class="footer-left-group">
<!-- Copyright -->
<div class="site-info">
<?php
$copyright_text = get_theme_mod( 'footer_copyright', '&copy; ' . date('Y') . ' ' . get_bloginfo('name') );
if ( get_theme_mod('show_footer_credit', true) ) {
$full_footer_text = $copyright_text . ' <span class="footer-separator">|</span> <span class="footer-credit">
<a href="https://m-viper.de" target="_blank" rel="noopener noreferrer">
Minecraft Theme by M_Viper
</a>
</span>';
} else {
$full_footer_text = $copyright_text;
}
echo '<p>' . wp_kses_post( $full_footer_text ) . '</p>';
?>
</div>
<!-- Footer Menü ( falls vorhanden ) -->
<?php if ( has_nav_menu( 'footer' ) ) : ?>
<nav class="footer-navigation">
<?php
wp_nav_menu(
array(
'theme_location' => 'footer',
'menu_class' => 'footer-menu',
'container' => false,
'depth' => 1, // Nur eine Ebene
)
);
?>
</nav>
<?php endif; ?>
</div>
<div class="footer-right-group">
<!-- Impressum & Datenschutz -->
<div class="footer-legal-links">
<?php
$impressum_url = get_theme_mod('footer_impressum_url');
$datenschutz_url = get_theme_mod('footer_datenschutz_url');
$links = array();
if (!empty($impressum_url)) {
$links[] = '<a href="' . esc_url($impressum_url) . '"><i class="fas fa-info-circle"></i> Impressum</a>';
}
if (!empty($datenschutz_url)) {
$links[] = '<a href="' . esc_url($datenschutz_url) . '"><i class="fas fa-shield-alt"></i> Datenschutz</a>';
}
if (!empty($links)) {
echo implode('', $links); // Kein Trennzeichen mehr, da wir Icons haben
}
?>
</div>
</div>
</div> <!-- Ende footer-bottom-bar -->
</div> <!-- Ende Container -->
<!-- THEME TOGGLE (Fixiert unten rechts) -->
<button class="theme-toggle" aria-label="Dark/Light Mode umschalten" title="Dark / Light Mode">
<div class="theme-toggle-icons">
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>
</svg>
<svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"/>
<line x1="12" y1="1" x2="12" y2="3"/>
<line x1="12" y1="21" x2="12" y2="23"/>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>
<line x1="1" y1="12" x2="3" y2="12"/>
<line x1="21" y1="12" x2="23" y2="12"/>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>
</svg>
</div>
</button>
</footer>
<?php wp_footer(); ?>
</body>
</html>