21 Commits
1.5 ... 1.6

Author SHA1 Message Date
ae3795337e Minecraft-Modern-Theme/style.css aktualisiert 2026-01-09 20:48:41 +00:00
43be3dd783 Upload style.css via GUI 2026-01-09 19:45:51 +00:00
afcabb0f10 Upload single-faq.php via GUI 2026-01-09 19:45:51 +00:00
99e9d76c97 Upload single.php via GUI 2026-01-09 19:45:50 +00:00
91586b8cee Upload page-login.php via GUI 2026-01-09 19:45:48 +00:00
156030f70d Upload page.php via GUI 2026-01-09 19:45:48 +00:00
603cc0a430 Upload index.php via GUI 2026-01-09 19:45:47 +00:00
23b93ec177 Upload header.php via GUI 2026-01-09 19:45:47 +00:00
839b1a2e85 Upload functions.php via GUI 2026-01-09 19:45:46 +00:00
b0d7f44d9a Upload front-page.php via GUI 2026-01-09 19:45:46 +00:00
fab5f1464c Upload footer.php via GUI 2026-01-09 19:45:45 +00:00
6b8301bff5 Upload dynamic-styles.php via GUI 2026-01-09 19:45:45 +00:00
a316e6a6dd Upload file archive-team.php via GUI 2026-01-09 20:45:43 +01:00
d334704927 Upload archive-faq.php via GUI 2026-01-09 19:45:35 +00:00
5004c0072c Update from Git Manager GUI 2026-01-09 20:45:33 +01:00
250d00aa20 Update from Git Manager GUI 2026-01-09 20:45:31 +01:00
519c7c6b52 Minecraft-Modern-Theme/header.php aktualisiert 2026-01-07 21:09:20 +00:00
8499b29174 Minecraft-Modern-Theme/style.css aktualisiert 2026-01-07 21:09:00 +00:00
b62c52cfad Minecraft-Modern-Theme/inc/theme-updater.php aktualisiert 2026-01-06 23:19:18 +00:00
57e758353a Minecraft-Modern-Theme/inc/customizer.php aktualisiert 2026-01-06 23:18:59 +00:00
ae4ec1dc30 Minecraft-Modern-Theme/functions.php aktualisiert 2026-01-06 23:18:47 +00:00
11 changed files with 2642 additions and 940 deletions

View File

@@ -0,0 +1,47 @@
<?php get_header(); ?>
<div class="container site-main">
<div class="content-area">
<div class="team-archive-container">
<header class="page-header">
<h1 class="page-title">Unser Team</h1>
<p class="page-description">Lerne die Leute kennen, die diesen Server am Laufen halten.</p>
</header>
<?php
$query = new WP_Query(array('post_type' => 'team_member', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'));
if ( $query->have_posts() ) : ?>
<div class="team-grid">
<?php while ( $query->have_posts() ) : $query->the_post();
$rank_string = get_post_meta( get_the_ID(), '_team_member_rank', true );
$img = get_the_post_thumbnail_url( get_the_ID(), 'medium' );
if ( !$img ) $img = get_template_directory_uri() . '/images/default-avatar.png';
?>
<article class="team-card">
<div class="team-image-wrapper">
<img src="<?php echo esc_url($img); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">
</div>
<div class="team-info">
<h3 class="team-name"><?php the_title(); ?></h3>
<div class="team-ranks-wrapper">
<?php if ( !empty($rank_string) ) {
$ranks = explode(',', $rank_string);
foreach ( $ranks as $r ) {
echo '<span class="team-rank">' . esc_html(trim($r)) . '</span>';
}
} ?>
</div>
<div class="team-bio"><?php the_excerpt(); ?></div>
</div>
</article>
<?php endwhile; ?>
</div>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p>Noch keine Teammitglieder.</p>
<?php endif; ?>
</div>
</div>
</div>
<?php get_footer(); ?>

View File

@@ -1,103 +1,103 @@
<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>
<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>

View File

@@ -1,92 +1,135 @@
<?php get_header(); ?>
<?php
if ( get_theme_mod('slider_enabled', false) ) :
?>
<section class="hero-slider swiper-container">
<div class="swiper-wrapper">
<?php
for ($i = 1; $i <= 5; $i++) :
$image_url = get_theme_mod('slider_image_' . $i);
if ($image_url) :
$title = get_theme_mod('slider_title_' . $i);
$subtitle = get_theme_mod('slider_subtitle_' . $i);
?>
<div class="swiper-slide" style="background-image: url('<?php echo esc_url($image_url); ?>');">
<div class="slider-content">
<?php if ($title) : ?>
<h2 class="slider-title"><?php echo esc_html($title); ?></h2>
<?php endif; ?>
<?php if ($subtitle) : ?>
<p class="slider-subtitle"><?php echo esc_html($subtitle); ?></p>
<?php endif; ?>
</div>
</div>
<?php
endif;
endfor;
?>
</div>
<!-- Nur anzeigen, wenn die Paginierung NICHT ausgeblendet ist -->
<?php if ( ! get_theme_mod('slider_hide_pagination', false) ) : ?>
<div class="swiper-pagination"></div>
<?php endif; ?>
<!-- Nur anzeigen, wenn die Pfeile NICHT ausgeblendet sind -->
<?php if ( ! get_theme_mod('slider_hide_arrows', false) ) : ?>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<?php endif; ?>
</section>
<?php else : ?>
<?php
$hero_bg = get_theme_mod( 'hero_bg_image' );
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
?>
<section class="hero-section" style="<?php echo $hero_bg ? "background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('" . esc_url($hero_bg) . "')" : ''; ?>">
<div class="container">
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
<div class="hero-buttons">
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
</div>
</div>
</section>
<?php endif; ?>
<main id="primary" class="site-main">
<div class="container">
<div class="content-area">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
</div>
<?php endif; ?>
<div class="post-content">
<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<!-- =================================================================== -->
<!-- === HIER IST DIE ÄNDERUNG: Vollen Inhalt anstelle des Auszugs === -->
<!-- =================================================================== -->
<div class="post-full-content">
<?php the_content(); ?>
</div>
</div>
</article>
<?php endwhile; else : ?>
<p><?php _e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
<?php endif; ?>
</div>
</div>
</main>
<?php get_footer(); ?>
<?php get_header(); ?>
<?php
// =====================================================
// HERO SLIDER ODER HERO SECTION
// =====================================================
if ( get_theme_mod('slider_enabled', false) ) :
?>
<section class="hero-slider swiper-container">
<div class="swiper-wrapper">
<?php
for ( $i = 1; $i <= 5; $i++ ) :
$image_url = get_theme_mod( 'slider_image_' . $i );
if ( $image_url ) :
$title = get_theme_mod( 'slider_title_' . $i );
$subtitle = get_theme_mod( 'slider_subtitle_' . $i );
?>
<div class="swiper-slide" style="background-image: url('<?php echo esc_url( $image_url ); ?>');">
<div class="slider-content">
<?php if ( $title ) : ?>
<h2 class="slider-title"><?php echo esc_html( $title ); ?></h2>
<?php endif; ?>
<?php if ( $subtitle ) : ?>
<p class="slider-subtitle"><?php echo esc_html( $subtitle ); ?></p>
<?php endif; ?>
</div>
</div>
<?php
endif;
endfor;
?>
</div>
<?php if ( ! get_theme_mod( 'slider_hide_pagination', false ) ) : ?>
<div class="swiper-pagination"></div>
<?php endif; ?>
<?php if ( ! get_theme_mod( 'slider_hide_arrows', false ) ) : ?>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<?php endif; ?>
</section>
<!-- ================================================= -->
<!-- ANNOUNCEMENT ANKER (unter Slider, ohne Scroll-Bug) -->
<!-- ================================================= -->
<div id="mm-announcement-anchor"></div>
<?php else : ?>
<?php
$hero_bg = get_theme_mod( 'hero_bg_image' );
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
?>
<section class="hero-section"
style="<?php
echo $hero_bg
? "background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('" . esc_url( $hero_bg ) . "')"
: '';
?>">
<div class="container">
<h1 class="hero-title"><?php echo esc_html( $hero_title ); ?></h1>
<p class="hero-subtitle"><?php echo esc_html( $hero_subtitle ); ?></p>
<div class="hero-buttons">
<a href="<?php echo esc_url( $btn1_url ); ?>" class="hero-button-1">
<?php echo esc_html( $btn1_text ); ?>
</a>
<a href="<?php echo esc_url( $btn2_url ); ?>" class="hero-button-2">
<?php echo esc_html( $btn2_text ); ?>
</a>
</div>
</div>
</section>
<!-- ================================================= -->
<!-- ANNOUNCEMENT ANKER (unter Hero, ohne Scroll-Bug) -->
<!-- ================================================= -->
<div id="mm-announcement-anchor"></div>
<?php endif; ?>
<!-- ===================================================== -->
<!-- MAIN CONTENT -->
<!-- ===================================================== -->
<main id="primary" class="site-main">
<div class="container">
<div class="content-area">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'medium_large' ); ?>
</a>
</div>
<?php endif; ?>
<div class="post-content">
<h2 class="post-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h2>
<div class="post-full-content">
<?php the_content(); ?>
</div>
</div>
</article>
<?php endwhile; ?>
<?php else : ?>
<p><?php esc_html_e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
<?php endif; ?>
</div>
</div>
</main>
<?php get_footer(); ?>

File diff suppressed because it is too large Load Diff

View File

@@ -1,81 +1,79 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header id="masthead" class="site-header">
<div class="container">
<div class="header-main">
<div class="site-branding">
<?php
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
the_custom_logo();
}
?>
<?php
if ( is_front_page() && is_home() ) :
?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif; ?>
</div>
<!-- NAVIGATION START -->
<nav id="site-navigation" class="main-navigation">
<!-- Mobile Toggle Button -->
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
<i class="fas fa-bars"></i>
</button>
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => false, // Wichtig: Kein Div-Wrapper drumherum
'menu_class' => 'primary-menu', // Unsere CSS Klasse
'fallback_cb' => false, // Kein Fallback anzeigen
) );
?>
</nav>
<!-- NAVIGATION ENDE -->
<div class="header-info">
<div class="social-links">
<?php
// Array mit den Social-Media-Plattformen und ihren Font Awesome Klassen
$social_icons = array(
'discord' => 'fab fa-discord',
'youtube' => 'fab fa-youtube',
'twitter' => 'fab fa-x-twitter', // Neues Icon für Twitter/X
'facebook' => 'fab fa-facebook-f',
'instagram' => 'fab fa-instagram',
'tiktok' => 'fab fa-tiktok',
'twitch' => 'fab fa-twitch',
'steam' => 'fab fa-steam',
'github' => 'fab fa-github',
'linkedin' => 'fab fa-linkedin-in',
'pinterest' => 'fab fa-pinterest-p',
'reddit' => 'fab fa-reddit-alien',
'teamspeak' => 'fab fa-teamspeak',
'spotify' => 'fab fa-spotify'
);
// Schleife, die alle verfügbaren Icons durchgeht
foreach ($social_icons as $key => $class) {
// Prüfen, ob für diese Plattform eine URL im Customizer hinterlegt wurde
if (get_theme_mod('social_' . $key)) {
// Wenn ja, Link und Icon ausgeben
echo '<a href="' . esc_url(get_theme_mod('social_' . $key)) . '" target="_blank"><i class="' . esc_attr($class) . '"></i></a>';
}
}
?>
</div>
</div>
</div>
</div>
</header>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<header id="masthead" class="site-header">
<div class="container">
<div class="header-main">
<div class="site-branding">
<?php
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
the_custom_logo();
}
?>
<?php
if ( is_front_page() && is_home() ) :
?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif; ?>
</div>
<!-- NAVIGATION START -->
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e('Hauptmenü','minecraft-modern-theme'); ?>">
<!-- Mobile Toggle Button -->
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
<i class="fas fa-bars"></i>
</button>
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'primary-menu',
'fallback_cb' => false,
) );
?>
</nav>
<!-- NAVIGATION ENDE -->
<div class="header-info">
<div class="social-links">
<?php
$social_icons = array(
'discord' => 'fab fa-discord',
'youtube' => 'fab fa-youtube',
'twitter' => 'fab fa-x-twitter',
'facebook' => 'fab fa-facebook-f',
'instagram' => 'fab fa-instagram',
'tiktok' => 'fab fa-tiktok',
'twitch' => 'fab fa-twitch',
'steam' => 'fab fa-steam',
'github' => 'fab fa-github',
'linkedin' => 'fab fa-linkedin-in',
'pinterest' => 'fab fa-pinterest-p',
'reddit' => 'fab fa-reddit-alien',
'teamspeak' => 'fab fa-teamspeak',
'spotify' => 'fab fa-spotify'
);
foreach ( $social_icons as $key => $class ) {
if ( get_theme_mod( 'social_' . $key ) ) {
echo '<a href="' . esc_url( get_theme_mod( 'social_' . $key ) ) . '" target="_blank" rel="noopener"><i class="' . esc_attr( $class ) . '"></i></a>';
}
}
?>
</div>
</div>
</div> <!-- .header-main -->
</div>
</header>

View File

@@ -1,4 +1,16 @@
<?php
/**
* Minecraft Modern Theme - Customizer Settings
*
* Enthält Einstellungen für:
* - Header Slider & Hero
* - Theme Presets (Nether, End, Classic)
* - Farben & Darstellung
* - Social Media
* - Footer
* - Login
* - Import/Export
*/
function minecraft_modern_customize_register( $wp_customize ) {
@@ -68,7 +80,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
'label' => 'Schriftfarbe', 'section' => 'header_slider', 'settings' => 'slider_font_color',
) ) );
// === VERGESSENE EINSTELLUNG WIEDER HINZUGEFÜGT ===
// Header-Höhe
$wp_customize->add_setting( 'header_height', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
$wp_customize->add_control( 'header_height', array(
'label' => 'Header-Höhe', 'section' => 'header_slider', 'settings' => 'header_height', 'type' => 'select',
@@ -84,10 +96,6 @@ function minecraft_modern_customize_register( $wp_customize ) {
'label' => 'Paginierung (Punkte) ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_pagination', 'type' => 'checkbox',
) );
// =========================================================================
// === ENTFERNT: Slider-Effekt-Einstellungen ==============================
// =========================================================================
// --- Sektion: Startseiten-Hero (Fallback) ---
$wp_customize->add_section( 'hero_section', array(
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
@@ -113,7 +121,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
// --- Checkbox: Seitentitel auf Startseite verstecken ---
$wp_customize->add_setting( 'show_home_title', array(
'default' => false, // Standard: Aus (Titel wird versteckt)
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'show_home_title', array(
@@ -135,6 +143,34 @@ function minecraft_modern_customize_register( $wp_customize ) {
'priority' => 30,
) );
// =========================================================================
// === NEU: THEME PRESETS (VOREINSTELLUNGEN) ==============================
// =========================================================================
$wp_customize->add_setting( 'theme_color_preset', array(
'default' => 'classic',
'sanitize_callback' => 'sanitize_key',
'transport' => 'refresh',
) );
$wp_customize->add_control( 'theme_color_preset', array(
'label' => 'Theme Preset (Farbschema)',
'description' => 'Wähle ein voreingestelltes Farbschema (z. B. für Nether oder End Dimension).',
'section' => 'theme_appearance_settings',
'settings' => 'theme_color_preset',
'type' => 'select',
'priority' => 1, // Zeig es ganz oben in dieser Sektion an
'choices' => array(
'classic' => 'Classic Minecraft (Diamant-Blau)',
'nether' => 'Nether (Lava-Rot)',
'end' => 'The End (Ender-Purpur)',
),
) );
// =========================================================================
// === ENDE THEME PRESETS ==================================================
// =========================================================================
// Akzentfarbe
$wp_customize->add_setting( 'primary_accent_color', array( 'default' => '#00d4ff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_accent_color', array(
@@ -215,6 +251,13 @@ function minecraft_modern_customize_register( $wp_customize ) {
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
) );
// --- Sektion: Team Einstellungen ---
$wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) );
$wp_customize->add_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
$wp_customize->add_control( 'team_enabled', array(
'label' => 'Team Showcase aktivieren', 'section' => 'team_settings', 'settings' => 'team_enabled', 'type' => 'checkbox',
) );
// =========================================================================
// === 6. LOGIN-BEREICH ====================================================
// =========================================================================
@@ -276,6 +319,121 @@ function minecraft_modern_customize_register( $wp_customize ) {
'type' => 'number',
'input_attrs' => array( 'min' => 2, 'max' => 10, 'step' => 1 ),
) );
// =========================================================================
// === 7. EXPORT / IMPORT SECTION =========================================
// =========================================================================
$wp_customize->add_section( 'theme_mods_import_export', array(
'title' => __( 'Einstellungen sichern', 'minecraft-modern-theme' ),
'priority' => 999,
'description' => '',
) );
// Füge ein Custom Control mit HTML hinzu
$wp_customize->add_setting( 'import_export_placeholder', array(
'sanitize_callback' => 'sanitize_text_field',
) );
// Custom Control Class für Export/Import
class Import_Export_Control extends WP_Customize_Control {
public $type = 'import_export';
public function render_content() {
$export_url = admin_url('admin-post.php?action=export_theme_settings');
$nonce = wp_create_nonce('theme-import-nonce');
?>
<div class="import-export-wrapper" style="margin-top: 15px;">
<p class="description" style="margin-bottom: 20px;">
<strong>Hinweis:</strong> Hier kannst du alle deine Theme-Einstellungen sichern und wiederherstellen.
</p>
<a href="<?php echo esc_url($export_url); ?>" class="button button-primary button-hero" id="export-settings-btn" style="display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;">
<span class="dashicons dashicons-download" style="margin-top:3px;"></span> Einstellungen Exportieren
</a>
<div style="border-top: 2px solid #ddd; padding-top: 20px; margin-top: 20px;">
<label style="display:block; margin-bottom:10px; font-weight:bold;">
Backup wiederherstellen:
</label>
<input type="file" id="import-settings-file" accept=".json" style="width:100%; margin-bottom:10px;">
<button type="button" class="button button-secondary" id="import-settings-btn" disabled style="display: inline-flex; align-items: center; gap: 8px;">
<span class="dashicons dashicons-upload" style="margin-top:3px;"></span> Einstellungen Importieren
</button>
</div>
<p class="description" style="margin-top:15px; padding: 10px; background: #fff3cd; border-left: 4px solid #ffc107;">
<strong>⚠️ Warnung:</strong> Beim Import werden alle aktuellen Einstellungen überschrieben!
</p>
</div>
<script type="text/javascript">
(function($) {
var ajaxUrl = '<?php echo admin_url('admin-ajax.php'); ?>';
var nonce = '<?php echo $nonce; ?>';
$('#import-settings-file').on('change', function() {
$('#import-settings-btn').prop('disabled', $(this).val() === '');
});
$('#import-settings-btn').on('click', function() {
var fileInput = $('#import-settings-file')[0];
if (fileInput.files.length === 0) {
alert('Bitte wähle eine JSON-Datei aus.');
return;
}
if (!confirm('WARNUNG: Alle aktuellen Einstellungen werden überschrieben. Bist du sicher?')) {
return;
}
var formData = new FormData();
formData.append('import_file', fileInput.files[0]);
formData.append('action', 'import_theme_settings');
formData.append('nonce', nonce);
var $btn = $(this);
var originalText = $btn.html();
$btn.prop('disabled', true).html('<span class="dashicons dashicons-update" style="margin-top:3px; animation: rotation 1s infinite linear;"></span> Importiere...');
$.ajax({
url: ajaxUrl,
type: 'POST',
data: formData,
processData: false,
contentType: false,
success: function(response) {
if (response.success) {
alert('✅ ' + response.data);
location.reload();
} else {
alert('❌ Fehler: ' + response.data);
$btn.prop('disabled', false).html(originalText);
}
},
error: function() {
alert('❌ Ein technischer Fehler ist aufgetreten.');
$btn.prop('disabled', false).html(originalText);
}
});
});
})(jQuery);
</script>
<style>
@keyframes rotation {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
</style>
<?php
}
}
$wp_customize->add_control( new Import_Export_Control( $wp_customize, 'import_export_placeholder', array(
'section' => 'theme_mods_import_export',
) ) );
}
add_action( 'customize_register', 'minecraft_modern_customize_register' );
@@ -289,7 +447,7 @@ function minecraft_modern_dynamic_css_output() {
$slider_font = get_theme_mod( 'slider_font_family', 'Raleway' );
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
$slider_size_setting = get_theme_mod( 'slider_font_size', 'mittel' );
$header_height_setting = get_theme_mod( 'header_height', 'mittel' ); // Diese Einstellung wird hier verwendet!
$header_height_setting = get_theme_mod( 'header_height', 'mittel' );
// Header-Höhe umwandeln
$header_height_value = '300px';
@@ -329,10 +487,6 @@ function minecraft_modern_dynamic_css_output() {
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
}
/* =================================================================== */
/* === NEU: Trennlinien mit der Akzentfarbe ========================= */
/* =================================================================== */
/* Trennlinie unter dem Header */
.site-header {
border-bottom: 4px solid var(--primary-accent);
@@ -347,8 +501,48 @@ function minecraft_modern_dynamic_css_output() {
.site-footer {
border-top: 4px solid var(--primary-accent);
}
</style>
<?php
}
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
// =========================================================================
// === THEME PRESET LOGIC (JAVASCRIPT) =====================================
// =========================================================================
/**
* Verbindet das Preset-Dropdown mit der Akzentfarbe-Einstellung.
* Sobald ein Preset gewählt wird, wird die Farbe im Customizer aktualisiert.
*/
function minecraft_preset_customize_js() {
?>
<script type="text/javascript">
(function($) {
// Definiere die Farben für die Presets
var presetColors = {
'classic': '#00d4ff', // Diamant Blau
'nether': '#ff3333', // Lava Rot
'end': '#aa00ff' // Ender Purpur
};
// Warten bis der Customizer bereit ist
wp.customize.bind('ready', function() {
// Listener für das Preset-Dropdown
wp.customize('theme_color_preset', function(setting) {
setting.bind(function(to) {
// Wenn eine Farbe für das gewählte Preset existiert...
if (presetColors[to]) {
// ...setze die Akzentfarbe auf diesen Wert.
// Das aktualisiert auch den Color Picker und die Live-Vorschau.
wp.customize('primary_accent_color').set(presetColors[to]);
}
});
});
});
})(jQuery);
</script>
<?php
}
add_action('customize_controls_print_footer_scripts', 'minecraft_preset_customize_js');

View File

@@ -1,125 +1,125 @@
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// === ZENTRALE VERSIONSKONSTANTE ===
// Bitte passen Sie diese Version bei jedem Release an!
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.4' );
// === THEME UPDATE NOTIFICATION SYSTEM ===
// Funktion zum Abrufen der neuesten Release-Informationen vom Git-Repository
function minecraft_modern_get_latest_release_info() {
$transient_key = 'minecraft_modern_latest_release';
// Versuche, die Daten aus dem Transient-Cache zu holen
$release_info = get_transient($transient_key);
// Wenn der Cache leer oder abgelaufen ist, rufe neue Daten ab
if (false === $release_info) {
$response = wp_remote_get('https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest');
if (!is_wp_error($response) && 200 === wp_remote_retrieve_response_code($response)) {
$body = wp_remote_retrieve_body($response);
$release_data = json_decode($body, true);
if ($release_data && isset($release_data['tag_name'])) {
$release_info = array(
'version' => $release_data['tag_name'],
'download_url' => $release_data['zipball_url'],
'release_notes' => isset($release_data['body']) ? $release_data['body'] : '',
'published_at' => isset($release_data['published_at']) ? $release_data['published_at'] : ''
);
// Speichere die Daten für 12 Stunden im Cache
set_transient($transient_key, $release_info, 12 * HOUR_IN_SECONDS);
}
} else {
// Bei Fehler, leere Daten für 1 Stunde cachen, um wiederholte fehlgeschlagene Anfragen zu vermeiden
set_transient($transient_key, array(), HOUR_IN_SECONDS);
}
}
return $release_info;
}
// Funktion zum Anzeigen der Update-Benachrichtigung im Admin-Bereich
function minecraft_modern_show_update_notification() {
// Nur im Admin-Bereich und für Administratoren anzeigen
if (!is_admin() || !current_user_can('manage_options')) {
return;
}
// Aktuelle Theme-Version abrufen (JETZT AUS UNSERER KONSTANTE)
$current_version = MINECRAFT_MODERN_THEME_VERSION;
// Neueste Release-Informationen abrufen
$latest_release = minecraft_modern_get_latest_release_info();
// Wenn wir gültige Release-Informationen haben und die Versionen unterschiedlich sind
if (!empty($latest_release) && isset($latest_release['version']) && version_compare($current_version, $latest_release['version'], '<')) {
?>
<div class="notice notice-warning is-dismissible">
<h3><?php _e('Minecraft Modern Theme Update Available', 'minecraft-modern-theme'); ?></h3>
<p>
<?php
printf(
__('You are using version %1$s of the Minecraft Modern Theme. Version %2$s is now available.', 'minecraft-modern-theme'),
'<strong>' . esc_html($current_version) . '</strong>',
'<strong>' . esc_html($latest_release['version']) . '</strong>'
);
?>
</p>
<p>
<a href="<?php echo esc_url($latest_release['download_url']); ?>" class="button button-primary" target="_blank">
<?php _e('Download Latest Version', 'minecraft-modern-theme'); ?>
</a>
<a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" class="button" target="_blank">
<?php _e('View Release Notes', 'minecraft-modern-theme'); ?>
</a>
</p>
</div>
<?php
}
}
add_action('admin_notices', 'minecraft_modern_show_update_notification');
// Funktion zum Hinzufügen eines Update-Status-Widgets zum Dashboard
function minecraft_modern_add_dashboard_widget() {
wp_add_dashboard_widget(
'minecraft_modern_update_widget', // Widget slug.
'Minecraft Modern Theme Status', // Title.
'minecraft_modern_update_widget_function' // Display function.
);
}
add_action('wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget');
// Funktion zum Anzeigen des Inhalts im Dashboard-Widget
function minecraft_modern_update_widget_function() {
// Aktuelle Theme-Version abrufen (JETZT AUS UNSERER KONSTANTE)
$current_version = MINECRAFT_MODERN_THEME_VERSION;
// Neueste Release-Informationen abrufen
$latest_release = minecraft_modern_get_latest_release_info();
echo '<p><strong>' . __('Current Version:', 'minecraft-modern-theme') . '</strong> ' . esc_html($current_version) . '</p>';
if (!empty($latest_release) && isset($latest_release['version'])) {
if (version_compare($current_version, $latest_release['version'], '<')) {
echo '<p><strong>' . __('Latest Version:', 'minecraft-modern-theme') . '</strong> <span style="color: #d63638;">' . esc_html($latest_release['version']) . '</span></p>';
echo '<p><strong>' . __('Status:', 'minecraft-modern-theme') . '</strong> <span style="color: #d63638;">' . __('Update Available', 'minecraft-modern-theme') . '</span></p>';
echo '<p><a href="' . esc_url($latest_release['download_url']) . '" class="button button-primary" target="_blank">' . __('Download Update', 'minecraft-modern-theme') . '</a></p>';
} else {
echo '<p><strong>' . __('Latest Version:', 'minecraft-modern-theme') . '</strong> <span style="color: #46b450;">' . esc_html($latest_release['version']) . '</span></p>';
echo '<p><strong>' . __('Status:', 'minecraft-modern-theme') . '</strong> <span style="color: #46b450;">' . __('Up to Date', 'minecraft-modern-theme') . '</span></p>';
}
} else {
echo '<p><strong>' . __('Status:', 'minecraft-modern-theme') . '</strong> ' . __('Unable to check for updates', 'minecraft-modern-theme') . '</p>';
}
echo '<p><a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" target="_blank">' . __('View All Releases', 'minecraft-modern-theme') . '</a></p>';
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// === ZENTRALE VERSIONSKONSTANTE ===
// Bitte passen Sie diese Version bei jedem Release an!
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.6' );
// === THEME UPDATE NOTIFICATION SYSTEM ===
// Funktion zum Abrufen der neuesten Release-Informationen vom Git-Repository
function minecraft_modern_get_latest_release_info() {
$transient_key = 'minecraft_modern_latest_release';
// Versuche, die Daten aus dem Transient-Cache zu holen
$release_info = get_transient($transient_key);
// Wenn der Cache leer oder abgelaufen ist, rufe neue Daten ab
if (false === $release_info) {
$response = wp_remote_get('https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest');
if (!is_wp_error($response) && 200 === wp_remote_retrieve_response_code($response)) {
$body = wp_remote_retrieve_body($response);
$release_data = json_decode($body, true);
if ($release_data && isset($release_data['tag_name'])) {
$release_info = array(
'version' => $release_data['tag_name'],
'download_url' => $release_data['zipball_url'],
'release_notes' => isset($release_data['body']) ? $release_data['body'] : '',
'published_at' => isset($release_data['published_at']) ? $release_data['published_at'] : ''
);
// Speichere die Daten für 12 Stunden im Cache
set_transient($transient_key, $release_info, 12 * HOUR_IN_SECONDS);
}
} else {
// Bei Fehler, leere Daten für 1 Stunde cachen, um wiederholte fehlgeschlagene Anfragen zu vermeiden
set_transient($transient_key, array(), HOUR_IN_SECONDS);
}
}
return $release_info;
}
// Funktion zum Anzeigen der Update-Benachrichtigung im Admin-Bereich
function minecraft_modern_show_update_notification() {
// Nur im Admin-Bereich und für Administratoren anzeigen
if (!is_admin() || !current_user_can('manage_options')) {
return;
}
// Aktuelle Theme-Version abrufen (JETZT AUS UNSERER KONSTANTE)
$current_version = MINECRAFT_MODERN_THEME_VERSION;
// Neueste Release-Informationen abrufen
$latest_release = minecraft_modern_get_latest_release_info();
// Wenn wir gültige Release-Informationen haben und die Versionen unterschiedlich sind
if (!empty($latest_release) && isset($latest_release['version']) && version_compare($current_version, $latest_release['version'], '<')) {
?>
<div class="notice notice-warning is-dismissible">
<h3><?php _e('Minecraft Modern Theme Update Available', 'minecraft-modern-theme'); ?></h3>
<p>
<?php
printf(
__('You are using version %1$s of the Minecraft Modern Theme. Version %2$s is now available.', 'minecraft-modern-theme'),
'<strong>' . esc_html($current_version) . '</strong>',
'<strong>' . esc_html($latest_release['version']) . '</strong>'
);
?>
</p>
<p>
<a href="<?php echo esc_url($latest_release['download_url']); ?>" class="button button-primary" target="_blank">
<?php _e('Download Latest Version', 'minecraft-modern-theme'); ?>
</a>
<a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" class="button" target="_blank">
<?php _e('View Release Notes', 'minecraft-modern-theme'); ?>
</a>
</p>
</div>
<?php
}
}
add_action('admin_notices', 'minecraft_modern_show_update_notification');
// Funktion zum Hinzufügen eines Update-Status-Widgets zum Dashboard
function minecraft_modern_add_dashboard_widget() {
wp_add_dashboard_widget(
'minecraft_modern_update_widget', // Widget slug.
'Minecraft Modern Theme Status', // Title.
'minecraft_modern_update_widget_function' // Display function.
);
}
add_action('wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget');
// Funktion zum Anzeigen des Inhalts im Dashboard-Widget
function minecraft_modern_update_widget_function() {
// Aktuelle Theme-Version abrufen (JETZT AUS UNSERER KONSTANTE)
$current_version = MINECRAFT_MODERN_THEME_VERSION;
// Neueste Release-Informationen abrufen
$latest_release = minecraft_modern_get_latest_release_info();
echo '<p><strong>' . __('Current Version:', 'minecraft-modern-theme') . '</strong> ' . esc_html($current_version) . '</p>';
if (!empty($latest_release) && isset($latest_release['version'])) {
if (version_compare($current_version, $latest_release['version'], '<')) {
echo '<p><strong>' . __('Latest Version:', 'minecraft-modern-theme') . '</strong> <span style="color: #d63638;">' . esc_html($latest_release['version']) . '</span></p>';
echo '<p><strong>' . __('Status:', 'minecraft-modern-theme') . '</strong> <span style="color: #d63638;">' . __('Update Available', 'minecraft-modern-theme') . '</span></p>';
echo '<p><a href="' . esc_url($latest_release['download_url']) . '" class="button button-primary" target="_blank">' . __('Download Update', 'minecraft-modern-theme') . '</a></p>';
} else {
echo '<p><strong>' . __('Latest Version:', 'minecraft-modern-theme') . '</strong> <span style="color: #46b450;">' . esc_html($latest_release['version']) . '</span></p>';
echo '<p><strong>' . __('Status:', 'minecraft-modern-theme') . '</strong> <span style="color: #46b450;">' . __('Up to Date', 'minecraft-modern-theme') . '</span></p>';
}
} else {
echo '<p><strong>' . __('Status:', 'minecraft-modern-theme') . '</strong> ' . __('Unable to check for updates', 'minecraft-modern-theme') . '</p>';
}
echo '<p><a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" target="_blank">' . __('View All Releases', 'minecraft-modern-theme') . '</a></p>';
}

View File

@@ -0,0 +1,84 @@
document.addEventListener("DOMContentLoaded", function () {
const bar = document.getElementById("mm-announcement");
if (!bar) return;
// --- 1. Positionierung ---
const position = bar.dataset.position || 'below-header';
if (position === "top") {
document.body.insertAdjacentElement('afterbegin', bar);
}
else if (position === "below-slider") {
const anchor = document.getElementById("mm-announcement-anchor");
if (anchor) {
anchor.replaceWith(bar);
} else {
const header = document.getElementById("masthead");
if (header) header.insertAdjacentElement('afterend', bar);
}
}
else if (position === "below-header") {
const header = document.getElementById("masthead");
if (header) header.insertAdjacentElement('afterend', bar);
}
else {
const header = document.getElementById("masthead");
if (header) header.insertAdjacentElement('afterend', bar);
}
const closeBtn = bar.querySelector(".mm-announcement-close");
if (closeBtn) {
closeBtn.addEventListener("click", function () {
bar.style.display = "none";
});
}
// --- 2. Countdown Timer Logik ---
const timerElement = document.querySelector('.mm-countdown-timer');
if (timerElement) {
const targetDateString = timerElement.getAttribute('data-date');
const expiredMessage = timerElement.getAttribute('data-expired');
// Prüfen ob Datum gesetzt ist
if (targetDateString) {
const countDownDate = new Date(targetDateString).getTime();
const updateTimer = setInterval(function() {
const now = new Date().getTime();
const distance = countDownDate - now;
if (distance < 0) {
clearInterval(updateTimer);
timerElement.innerHTML = expiredMessage;
// Optional: Rot einfärben wenn abgelaufen
timerElement.style.color = '#ff3333';
return;
}
// Zeitberechnung
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Formatierung (z.B. 05 statt 5)
const fDays = days > 0 ? days + "d " : "";
const fHours = hours < 10 ? "0" + hours : hours;
const fMinutes = minutes < 10 ? "0" + minutes : minutes;
const fSeconds = seconds < 10 ? "0" + seconds : seconds;
timerElement.innerHTML = fDays + fHours + ":" + fMinutes + ":" + fSeconds;
}, 1000);
// Sofort einmal ausführen, um Ladezeit zu vermeiden
// Wir lösen das Interval manuell für den ersten Durchlauf aus,
// indem wir den Code kopieren oder den Timeout kurz setzen.
// Für diesen Fall reicht der erste Tick nach 1 Sekunde,
// aber wir können es direkt aufrufen:
// (Hier nutzen wir einfach den ersten Tick des Intervals)
} else {
timerElement.style.display = 'none';
}
}
});

View File

@@ -0,0 +1,158 @@
(function($){
$(document).ready(function(){
const fonts = window.MM_Announcement_Fonts || {};
const current = window.MM_Announcement_Current || {};
const fontSelect = $('#mm-announcement-font');
const sizeInput = $('#mm-announcement-size');
const bgInput = $('#mm-announcement-bg');
const colorInput = $('#mm-announcement-color');
const previewText = $('#mm-announcement-preview-text');
const previewWrap = $('#mm-announcement-preview');
const positionSelect = $('#mm-announcement-position');
// Helper: lädt Google-Font-Link oder updatet existing
function ensureGoogleFont(googleName) {
if (!googleName) return;
const id = 'mm-admin-google-font';
const href = 'https://fonts.googleapis.com/css2?family=' + encodeURIComponent(googleName) + ':wght@400;700&display=swap';
let link = document.getElementById(id);
if (link) {
if (link.getAttribute('href') !== href) link.setAttribute('href', href);
} else {
link = document.createElement('link');
link.id = id;
link.rel = 'stylesheet';
link.href = href;
document.head.appendChild(link);
}
}
// Update preview appearance based on font key
function updatePreviewForFontKey(key) {
const meta = fonts[key];
if (!meta) {
previewText.css('font-family', '');
return;
}
previewText.css('font-family', meta.css);
if (meta.google && meta.google_name) {
ensureGoogleFont(meta.google_name);
}
}
// Update size/colors/position UI
function updateSizeAndColors() {
const size = parseInt(sizeInput.val(), 10) || 16;
previewText.css('font-size', size + 'px');
previewWrap.css('background', bgInput.val());
previewWrap.css('color', colorInput.val());
}
// Read content from wp_editor (TinyMCE) or textarea
function getEditorText() {
// Try TinyMCE first
if ( typeof tinymce !== 'undefined' ) {
try {
const ed = tinymce.get('mm_announcement_text');
if (ed && !ed.isHidden()) {
// getContent then strip tags
const html = ed.getContent({format: 'html'});
const tmp = document.createElement('div');
tmp.innerHTML = html;
return tmp.textContent || tmp.innerText || '';
}
} catch (e) {
// ignore
}
}
// Fallback to textarea
const ta = $('#mm_announcement_text');
if (ta.length) {
const tmp = document.createElement('div');
tmp.innerHTML = ta.val();
return tmp.textContent || tmp.innerText || '';
}
return '';
}
// Update preview text from editor content
function updatePreviewTextFromEditor() {
const text = getEditorText();
if (text && text.trim().length) {
previewText.text(text.trim());
} else {
previewText.text(current.text || 'Das ist eine Vorschau: Wie sieht die Schrift aus?');
}
}
// Initialize controls with current settings
if (current.font) {
updatePreviewForFontKey(current.font);
fontSelect.val(current.font);
} else {
updatePreviewForFontKey(fontSelect.val());
}
if (current.size) sizeInput.val(current.size);
if (current.bg) bgInput.val(current.bg);
if (current.color) colorInput.val(current.color);
updateSizeAndColors();
updatePreviewTextFromEditor();
// Attach events --------------------------------------------------
// font change
fontSelect.on('change', function(){
const key = $(this).val();
updatePreviewForFontKey(key);
});
// size/color/position change
sizeInput.on('input change', updateSizeAndColors );
bgInput.on('input change', updateSizeAndColors );
colorInput.on('input change', updateSizeAndColors );
// Editor changes:
// - TinyMCE: listen for keyup / change events when editor is ready
// - Textarea: listen for input
function attachEditorListeners() {
// TinyMCE
if ( typeof tinymce !== 'undefined' ) {
const ed = tinymce.get('mm_announcement_text');
if (ed) {
ed.on('keyup change NodeChange', function(){
updatePreviewTextFromEditor();
});
}
}
// Textarea fallback
$('#mm_announcement_text').on('input change', function(){
updatePreviewTextFromEditor();
});
}
// TinyMCE initialisation might be async — poll short time then attach
let tries = 0;
const waitForEditor = setInterval(function(){
tries++;
if ( (typeof tinymce !== 'undefined' && tinymce.get('mm_announcement_text')) || $('#mm_announcement_text').length ) {
clearInterval(waitForEditor);
attachEditorListeners();
} else if (tries > 30) { // about 3s
clearInterval(waitForEditor);
// still attach textarea event just in case
$('#mm_announcement_text').on('input change', updatePreviewTextFromEditor);
}
}, 100);
// Also update preview when the form is programmatically changed (e.g., quicktags)
$(document).on('change', '#mm-announcement-font, #mm-announcement-size, #mm-announcement-bg, #mm-announcement-color', function(){
updateSizeAndColors();
updatePreviewForFontKey($('#mm-announcement-font').val());
updatePreviewTextFromEditor();
});
});
})(jQuery);

View File

@@ -1,84 +1,84 @@
<?php
/*
Template Name: Benutzerdefinierte Authentifizierungsseite
*/
get_header(); ?>
<div class="container">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<div class="custom-auth-container">
<?php if (is_user_logged_in()) : ?>
<!-- Wenn der Benutzer angemeldet ist, zeige eine Nachricht und einen Logout-Link -->
<div class="logged-in-message">
<h2>Willkommen zurück, <?php echo esc_html(wp_get_current_user()->display_name); ?>!</h2>
<p>Du bist bereits angemeldet.</p>
<p>
<a href="<?php echo esc_url(wp_logout_url(home_url())); ?>" class="button">Abmelden</a>
<a href="<?php echo esc_url(admin_url()); ?>" class="button">Zum Dashboard</a>
</p>
</div>
<?php else : ?>
<!-- Wenn der Benutzer nicht angemeldet ist, zeige das Registrierungsformular -->
<h1 class="auth-title">Willkommen auf <?php bloginfo('name'); ?></h1>
<p class="auth-subtitle">Erstelle deinen Account und werde Teil unserer Community!</p>
<?php
// Zeige das Registrierungsformular an
$args = array(
'echo' => true,
'redirect' => home_url('/login/?checkemail=registered'), // Weiterleitung nach der Registrierung
'form_id' => 'custom_registerform',
'label_username' => __( 'Benutzername' ),
'label_email' => __( 'E-Mail-Adresse' ),
'label_password' => __( 'Passwort' ),
'label_remember' => __( 'Angemeldet bleiben' ),
'label_log_in' => __( 'Registrieren' ),
'id_username' => 'user_login',
'id_email' => 'user_email',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => true,
'value_username' => NULL,
'value_remember' => false
);
wp_register_form($args);
?>
<div class="login-form-link">
<p>Schon hast du einen Account? <a href="<?php echo esc_url(wp_login_url()); ?>">Hier anmelden</a>.</p>
</div>
<?php endif; ?>
</div>
</main>
</div>
</div>
<?php
// Hintergrundbild aus dem Customizer holen und als Inline-CSS ausgeben
$auth_bg_image = get_theme_mod('login_background_image');
if ($auth_bg_image):
?>
<style>
body.login, body.login-action-register {
background-image: url('<?php echo esc_url($auth_bg_image); ?>') !important;
background-size: cover !important;
background-position: center !important;
background-repeat: no-repeat !important;
}
body.login::before, body.login-action-register::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(20, 21, 26, 0.8);
z-index: -1;
}
</style>
<?php endif; ?>
<?php
/*
Template Name: Benutzerdefinierte Authentifizierungsseite
*/
get_header(); ?>
<div class="container">
<div id="primary" class="content-area">
<main id="main" class="site-main">
<div class="custom-auth-container">
<?php if (is_user_logged_in()) : ?>
<!-- Wenn der Benutzer angemeldet ist, zeige eine Nachricht und einen Logout-Link -->
<div class="logged-in-message">
<h2>Willkommen zurück, <?php echo esc_html(wp_get_current_user()->display_name); ?>!</h2>
<p>Du bist bereits angemeldet.</p>
<p>
<a href="<?php echo esc_url(wp_logout_url(home_url())); ?>" class="button">Abmelden</a>
<a href="<?php echo esc_url(admin_url()); ?>" class="button">Zum Dashboard</a>
</p>
</div>
<?php else : ?>
<!-- Wenn der Benutzer nicht angemeldet ist, zeige das Registrierungsformular -->
<h1 class="auth-title">Willkommen auf <?php bloginfo('name'); ?></h1>
<p class="auth-subtitle">Erstelle deinen Account und werde Teil unserer Community!</p>
<?php
// Zeige das Registrierungsformular an
$args = array(
'echo' => true,
'redirect' => home_url('/login/?checkemail=registered'), // Weiterleitung nach der Registrierung
'form_id' => 'custom_registerform',
'label_username' => __( 'Benutzername' ),
'label_email' => __( 'E-Mail-Adresse' ),
'label_password' => __( 'Passwort' ),
'label_remember' => __( 'Angemeldet bleiben' ),
'label_log_in' => __( 'Registrieren' ),
'id_username' => 'user_login',
'id_email' => 'user_email',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => true,
'value_username' => NULL,
'value_remember' => false
);
wp_register_form($args);
?>
<div class="login-form-link">
<p>Schon hast du einen Account? <a href="<?php echo esc_url(wp_login_url()); ?>">Hier anmelden</a>.</p>
</div>
<?php endif; ?>
</div>
</main>
</div>
</div>
<?php
// Hintergrundbild aus dem Customizer holen und als Inline-CSS ausgeben
$auth_bg_image = get_theme_mod('login_background_image');
if ($auth_bg_image):
?>
<style>
body.login, body.login-action-register {
background-image: url('<?php echo esc_url($auth_bg_image); ?>') !important;
background-size: cover !important;
background-position: center !important;
background-repeat: no-repeat !important;
}
body.login::before, body.login-action-register::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(20, 21, 26, 0.8);
z-index: -1;
}
</style>
<?php endif; ?>
<?php get_footer(); ?>

View File

@@ -4,7 +4,7 @@ Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
Author: M_Viper
Description: Ein modernes Gaming-Theme mit konfigurierbarem Header-Slider.
Author URI: https://M-Viper.de
Version: 1.5
Version: 1.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minecraft-modern-theme
@@ -73,7 +73,7 @@ a:hover { color: #fff; }
.site-header {
background-color: var(--header-bg);
backdrop-filter: blur(10px);
padding: 15px 0;
padding: 30px 0; /* FIX: Mehr vertikaler Platz im Header */
position: sticky;
top: 0;
z-index: 1000;
@@ -87,10 +87,15 @@ a:hover { color: #fff; }
.header-main {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 120px; /* Gleichmäßiger Abstand zwischen den Elementen */
justify-content: space-between; /* FIX: Logo Links, Menü Mitte, Info Rechts */
gap: 40px; /* Flexiblerer Abstand */
}
/* WICHTIG: Typo im Header.html korrigieren!
HTML: <div class="site-branding">
CSS: .site-branding
Sie müssen die 'g' im HTML oder CSS angleichen, sonst ist das Layout kaputt.
*/
.site-branding {
display: flex;
align-items: center;
@@ -117,12 +122,13 @@ a:hover { color: #fff; }
/* === NEUE DROPDOWN NAVIGATION ======================================= */
/* =================================================================== */
.main-navigation {
#site-navigation {
position: relative;
flex-grow: 1;
flex-grow: 1; /* FIX: Navigation nimmt den gesamten Platz in der Mitte ein */
display: flex;
justify-content: center; /* Zentriert das Menü */
justify-content: center; /* Zentriert das Menü innerhalb seines Raums */
align-items: center;
padding: 0 30px; /* Mindestabstand zu Logo und Socials */
}
/* Hauptliste (Top Level) */
@@ -132,7 +138,7 @@ a:hover { color: #fff; }
list-style: none;
margin: 0;
padding: 0;
gap: 25px;
gap: 20px; /* Abstand zwischen Menüpunkten horizontal */
}
/* Menüpunkte */
@@ -142,12 +148,12 @@ a:hover { color: #fff; }
/* Links in der Navigation */
.main-navigation a {
display: block;
display: inline-block;
font-size: 15px;
font-weight: 600;
color: var(--text-muted);
text-decoration: none;
padding: 10px 0;
padding: 20px 0; /* FIX: Mehr vertikaler Platz (Oben/Unten) ohne horizontales Padding */
transition: color 0.3s ease;
position: relative;
}
@@ -178,7 +184,7 @@ a:hover { color: #fff; }
top: 100%; /* Direkt unter dem Elternpunkt */
left: 0;
background-color: var(--surface-color);
border: 1px solid var(--border-color);
border:1px solid var(--border-color);
border-top: 3px solid var(--primary-accent);
min-width: 240px;
list-style: none;
@@ -209,6 +215,12 @@ a:hover { color: #fff; }
border-bottom: 1px solid rgba(255,255,255,0.05);
font-size: 14px;
white-space: nowrap;
/* FIX: Vollständige Hintergrund-Markierung */
display: block;
width: 100%;
box-sizing: border-box; /* Padding wird zur Breite hinzugezählt */
transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.sub-menu li:last-child a {
@@ -658,7 +670,7 @@ html.light-mode .icon-sun { opacity: 1; }
}
.faq-answer p { margin-bottom: 20px; font-size: 0.9rem; }
.faq-item.active .faq-answer {
padding: 0 20px 20px 20px;
padding: 0 20px 20px;
max-height: 1000px;
transition: max-height 0.4s ease-in, padding 0.4s ease-in;
}
@@ -683,6 +695,7 @@ html.light-mode .icon-sun { opacity: 1; }
border: 1px solid var(--border-color);
padding: 40px;
margin-bottom: 30px;
margin-top: 40px;
}
.faq-tabs {
@@ -881,7 +894,7 @@ main#primary.site-main {
.site-branding { flex-grow: 1; }
.header-info { order: 2; } /* Social rechts */
.main-navigation { order: 3; width: 100%; }
#site-navigation { order: 3; width: 100%; }
.menu-toggle {
display: block;
@@ -902,13 +915,13 @@ main#primary.site-main {
}
/* Wenn .toggled aktiv ist, zeigen */
.main-navigation.toggled .primary-menu {
#site-navigation.toggled .primary-menu {
display: flex;
animation: slideDown 0.3s ease forwards;
}
.menu-item { width: 100%; text-align: left; }
.main-navigation a { padding: 15px 20px; }
#site-navigation a { padding: 15px 20px; }
/* Submenus mobil - Akkordeon Style */
.sub-menu {
@@ -949,8 +962,8 @@ main#primary.site-main {
.custom-logo-link img, .custom-logo { max-height: 50px; }
/* Hero */
.hero-title, .slider-title { font-size: 32px; }
.hero-subtitle, .slider-subtitle { font-size: 18px; }
.slider-title { font-size: 32px; }
.slider-subtitle { font-size: 18px; }
.hero-buttons a { display: block; margin: 10px auto; width: 80%; }
/* Footer Responsive */
@@ -1006,4 +1019,268 @@ main#primary.site-main {
body.home-title-hidden .site-main .entry-header,
body.home-title-hidden .site-main .page-header {
display: none !important;
}
/* Announcement Bar - basics */
#mm-announcement {
width: 100%;
position: relative;
z-index: 9999;
box-sizing: border-box;
transition: all 220ms ease;
}
/* Inner container centers text and keeps close button to the right */
.mm-announcement-inner {
max-width: 1400px;
margin: 0 auto;
padding: 12px 20px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
/* Text center */
.mm-announcement-text {
text-align: center;
line-height: 1.2;
}
/* Close button on the right edge of the inner container */
.mm-announcement-close {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: inherit;
font-size: 22px;
cursor: pointer;
padding: 6px;
line-height: 1;
}
/* Responsive tweaks */
@media (max-width: 600px) {
.mm-announcement-inner {
padding: 10px 12px;
}
.mm-announcement-close {
right: 12px;
font-size: 20px;
}
.mm-announcement-text { font-size: 14px; }
}
/* ==========================================================================
TEAM / STAFF SHOWCASE STYLES (AKTUALISIERT)
========================================================================== */
/* --- WICHTIG: Container Breite definieren ---
Das sorgt dafür, dass die Cards breiter werden können. */
.container {
max-width: 1500px; /* Von 1200px auf 1500px erhöht für breitere Karten */
margin: 0 auto;
padding: 0 20px;
width: 100%;
}
/* --- 1. Container Der Hintergrund-Karton --- */
.team-archive-container {
background-color: var(--card-bg);
border-radius: 8px;
border: 1px solid var(--border-color);
padding: 50px;
margin-bottom: 30px;
margin-top: 40px;
}
.page-header {
text-align: center;
margin-bottom: 50px;
}
.page-header .page-title {
font-size: 2.5rem;
color: var(--primary-accent);
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 10px;
}
.page-header .page-description {
font-size: 1.2rem;
color: var(--text-muted);
}
/* --- 2. Grid Layout (FESTE 3 SPALTEN) --- */
.team-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 25px; /* Etwas weniger Abstand = Mehr Breite */
}
/* --- 3. Team Card Design (AKTUELL) --- */
.team-card {
background-color: transparent;
/* AKTUALISIERUNG: Border ist jetzt die Akzentfarbe (farbig) */
border: 1.5px solid var(--primary-accent);
border-radius: 12px;
overflow: visible; /* Avatar soll über den Rand ragen */
transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 0 0 40px 0;
margin-top: 50px;
height: 70%;
width: 100%;
justify-content: space-between;
}
/* Hover Effekt */
.team-card:hover {
transform: translateY(-10px);
/* Border wird beim Hover auch heller oder die Glow-Farbe je nach Wunsch */
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 212, 255, 0.4);
}
/* --- 4. Runder Avatar (AKTUELL) --- */
.team-image-wrapper {
margin-top: -50px;
width: 150px;
height: 150px;
border-radius: 50%;
border: 5px solid var(--card-bg); /* Innerer Hintergrund-Rand */
/* WICHTIG: Hier ist KEIN box-shadow mehr (Kein dauerhafter Glow) */
overflow: hidden;
background-color: #000;
z-index: 2;
flex-shrink: 0;
/* Transition für den Hover-Effekt hinzugefügt */
transition: transform 0.5s ease, box-shadow 0.3s ease;
}
.team-image-wrapper img {
width: 100%;
height: 100%;
object-fit: cover;
}
/* --- NEU: Glow ONLY ON HOVER --- */
/* Wenn Maus auf die Karte fährt, bekommt der Avatar einen Glow */
.team-card:hover .team-image-wrapper {
/* Der Glow erscheint nur hier */
box-shadow: 0 0 0 6px var(--primary-accent);
}
/* Zusätzlich: Zoom-Effekt beim Hover (Optionale Verfeinerung) */
.team-card:hover .team-image-wrapper img {
transform: scale(1.05);
}
/* --- 5. Info Bereich --- */
.team-info {
padding: 15px 35px 0 35px;
width: 100%;
display: flex;
flex-direction: column;
flex-grow: 1;
}
.team-name {
margin: 20px 0 8px 0;
font-size: 1.8rem;
color: var(--text-color);
font-weight: 700;
line-height: 1.2;
min-height: 1.2em;
}
/* --- 6. Mehrere Ränge (Wrapper) --- */
.team-ranks-wrapper {
margin-bottom: 20px;
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
}
.team-rank {
display: inline-block;
background-color: rgba(0, 212, 255, 0.1);
color: var(--primary-accent);
padding: 6px 16px;
border-radius: 25px;
font-size: 0.85rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
border: 1px solid rgba(0, 212, 255, 0.3);
}
/* --- 7. Bio Text (Begrenzung & Styling) --- */
.team-bio {
font-size: 1rem;
color: var(--text-muted);
line-height: 1.6;
/* Füllt den restlichen Platz bis unten aus */
margin-top: auto;
/* Begrenzung auf max 4 Zeilen */
display: -webkit-box;
-webkit-line-clamp: 4;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
/* Fallback für alte Browser */
max-height: 6.4em;
}
/* --- 8. Responsive Design (Tablet & Mobile) --- */
/* Tablet (2 Spalten) */
@media (max-width: 1100px) {
.team-grid {
grid-template-columns: repeat(2, 1fr);
gap: 30px;
}
.team-name { font-size: 1.6rem; }
}
/* Mobile (1 Spalte) */
@media (max-width: 768px) {
.container {
padding: 0 15px;
max-width: 100%;
}
.team-grid {
grid-template-columns: 1fr;
gap: 25px;
}
.team-archive-container {
padding: 30px 20px;
}
.team-name {
font-size: 1.5rem;
}
.team-image-wrapper {
width: 120px;
height: 120px;
margin-top: -40px;
}
}