17 Commits
1.7 ... 1.8

6 changed files with 2165 additions and 1559 deletions

View File

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

View File

@@ -1,135 +1,416 @@
<?php get_header(); ?> <?php get_header(); ?>
<?php <?php
// ===================================================== // =====================================================
// HERO SLIDER ODER HERO SECTION // HERO SLIDER ODER HERO SECTION
// ===================================================== // =====================================================
if ( get_theme_mod('slider_enabled', false) ) : if ( get_theme_mod('slider_enabled', false) ) :
?> ?>
<section class="hero-slider swiper-container"> <section class="hero-slider swiper-container">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<?php <?php
for ( $i = 1; $i <= 5; $i++ ) : for ( $i = 1; $i <= 5; $i++ ) :
$image_url = get_theme_mod( 'slider_image_' . $i ); $image_url = get_theme_mod( 'slider_image_' . $i );
if ( $image_url ) : if ( $image_url ) :
$title = get_theme_mod( 'slider_title_' . $i ); $title = get_theme_mod( 'slider_title_' . $i );
$subtitle = get_theme_mod( 'slider_subtitle_' . $i ); $subtitle = get_theme_mod( 'slider_subtitle_' . $i );
?> ?>
<div class="swiper-slide" style="background-image: url('<?php echo esc_url( $image_url ); ?>');"> <div class="swiper-slide" style="background-image: url('<?php echo esc_url( $image_url ); ?>');">
<div class="slider-content"> <div class="slider-content">
<?php if ( $title ) : ?> <?php if ( $title ) : ?>
<h2 class="slider-title"><?php echo esc_html( $title ); ?></h2> <h2 class="slider-title"><?php echo esc_html( $title ); ?></h2>
<?php endif; ?> <?php endif; ?>
<?php if ( $subtitle ) : ?> <?php if ( $subtitle ) : ?>
<p class="slider-subtitle"><?php echo esc_html( $subtitle ); ?></p> <p class="slider-subtitle"><?php echo esc_html( $subtitle ); ?></p>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<?php <?php
endif; endif;
endfor; endfor;
?> ?>
</div> </div>
<?php if ( ! get_theme_mod( 'slider_hide_pagination', false ) ) : ?> <?php if ( ! get_theme_mod( 'slider_hide_pagination', false ) ) : ?>
<div class="swiper-pagination"></div> <div class="swiper-pagination"></div>
<?php endif; ?> <?php endif; ?>
<?php if ( ! get_theme_mod( 'slider_hide_arrows', false ) ) : ?> <?php if ( ! get_theme_mod( 'slider_hide_arrows', false ) ) : ?>
<div class="swiper-button-prev"></div> <div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div> <div class="swiper-button-next"></div>
<?php endif; ?> <?php endif; ?>
</section> </section>
<!-- ================================================= --> <!-- ================================================= -->
<!-- ANNOUNCEMENT ANKER (unter Slider, ohne Scroll-Bug) --> <!-- ANNOUNCEMENT ANKER (unter Slider, ohne Scroll-Bug) -->
<!-- ================================================= --> <!-- ================================================= -->
<div id="mm-announcement-anchor"></div> <div id="mm-announcement-anchor"></div>
<?php else : ?> <?php else : ?>
<?php <?php
$hero_bg = get_theme_mod( 'hero_bg_image' ); $hero_bg = get_theme_mod( 'hero_bg_image' );
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' ); $hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' ); $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_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' ); $btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' ); $btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' ); $btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
?> ?>
<section class="hero-section" <section class="hero-section"
style="<?php style="<?php
echo $hero_bg echo $hero_bg
? "background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('" . esc_url( $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"> <div class="container">
<h1 class="hero-title"><?php echo esc_html( $hero_title ); ?></h1> <h1 class="hero-title"><?php echo esc_html( $hero_title ); ?></h1>
<p class="hero-subtitle"><?php echo esc_html( $hero_subtitle ); ?></p> <p class="hero-subtitle"><?php echo esc_html( $hero_subtitle ); ?></p>
<div class="hero-buttons"> <div class="hero-buttons">
<a href="<?php echo esc_url( $btn1_url ); ?>" class="hero-button-1"> <a href="<?php echo esc_url( $btn1_url ); ?>" class="hero-button-1">
<?php echo esc_html( $btn1_text ); ?> <?php echo esc_html( $btn1_text ); ?>
</a> </a>
<a href="<?php echo esc_url( $btn2_url ); ?>" class="hero-button-2"> <a href="<?php echo esc_url( $btn2_url ); ?>" class="hero-button-2">
<?php echo esc_html( $btn2_text ); ?> <?php echo esc_html( $btn2_text ); ?>
</a> </a>
</div> </div>
</div> </div>
</section> </section>
<!-- ================================================= --> <!-- ================================================= -->
<!-- ANNOUNCEMENT ANKER (unter Hero, ohne Scroll-Bug) --> <!-- ANNOUNCEMENT ANKER (unter Hero, ohne Scroll-Bug) -->
<!-- ================================================= --> <!-- ================================================= -->
<div id="mm-announcement-anchor"></div> <div id="mm-announcement-anchor"></div>
<?php endif; ?> <?php endif; ?>
<!-- ===================================================== --> <!-- ===================================================== -->
<!-- MAIN CONTENT --> <!-- MAIN CONTENT MIT SIDEBAR -->
<!-- ===================================================== --> <!-- ===================================================== -->
<main id="primary" class="site-main"> <main id="primary" class="site-main">
<div class="container"> <div class="container">
<div class="content-area">
<?php
<?php if ( have_posts() ) : ?> // Hole Sidebar-Einstellungen
<?php while ( have_posts() ) : the_post(); ?> $sidebar_enabled = get_theme_mod( 'homepage_sidebar_enabled', false );
$sidebar_position = get_theme_mod( 'homepage_sidebar_position', 'right' );
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
// Prüfe ob mindestens ein Sidebar-Bereich aktiv ist
<?php if ( has_post_thumbnail() ) : ?> $has_sidebar_content = (
<div class="post-thumbnail"> is_active_sidebar( 'homepage-sidebar-top' ) ||
<a href="<?php the_permalink(); ?>"> is_active_sidebar( 'homepage-sidebar-middle-1' ) ||
<?php the_post_thumbnail( 'medium_large' ); ?> is_active_sidebar( 'homepage-sidebar-middle-2' ) ||
</a> is_active_sidebar( 'homepage-sidebar-bottom' ) ||
</div> is_active_sidebar( 'homepage-sidebar-extra' )
<?php endif; ?> );
<div class="post-content"> // Setze CSS-Klassen basierend auf Sidebar-Status
<h2 class="post-title"> $content_class = 'content-area';
<a href="<?php the_permalink(); ?>"> if ( $sidebar_enabled && $has_sidebar_content ) {
<?php the_title(); ?> $content_class = 'content-area with-sidebar sidebar-' . esc_attr( $sidebar_position );
</a> }
</h2> ?>
<div class="post-full-content"> <div class="<?php echo esc_attr( $content_class ); ?>">
<?php the_content(); ?>
</div> <?php if ( $sidebar_enabled && $sidebar_position === 'left' && $has_sidebar_content ) : ?>
</div> <!-- SIDEBAR LINKS -->
<aside class="homepage-sidebar sidebar-left">
</article> <?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
<div class="sidebar-section sidebar-top">
<?php endwhile; ?> <?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
<?php else : ?> </div>
<?php endif; ?>
<p><?php esc_html_e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
<?php endif; ?> <div class="sidebar-section sidebar-middle-1">
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
</div> </div>
</div> <?php endif; ?>
</main>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
<?php get_footer(); ?> <div class="sidebar-section sidebar-middle-2">
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
<div class="sidebar-section sidebar-bottom">
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
<div class="sidebar-section sidebar-extra">
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
</div>
<?php endif; ?>
</aside>
<?php endif; ?>
<!-- HAUPTINHALT -->
<div class="main-content">
<?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>
<?php if ( $sidebar_enabled && $sidebar_position === 'right' && $has_sidebar_content ) : ?>
<!-- SIDEBAR RECHTS -->
<aside class="homepage-sidebar sidebar-right">
<?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
<div class="sidebar-section sidebar-top">
<?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
<div class="sidebar-section sidebar-middle-1">
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
<div class="sidebar-section sidebar-middle-2">
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
<div class="sidebar-section sidebar-bottom">
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
<div class="sidebar-section sidebar-extra">
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
</div>
<?php endif; ?>
</aside>
<?php endif; ?>
</div>
</div>
</main>
<!-- ===================================================== -->
<!-- ZUSÄTZLICHES CSS FÜR SIDEBAR LAYOUT -->
<!-- ===================================================== -->
<style>
/* Content ohne Sidebar - volle Breite */
.content-area .main-content {
width: 100%;
margin-bottom: 40px;
}
/* Container mit Sidebar-Layout */
.content-area.with-sidebar {
display: grid;
gap: 30px;
align-items: start;
}
/* Sidebar rechts (Standard) */
.content-area.with-sidebar.sidebar-right {
grid-template-columns: 1fr 300px;
}
.content-area.with-sidebar.sidebar-right .main-content {
order: 1;
}
.content-area.with-sidebar.sidebar-right .homepage-sidebar {
order: 2;
}
/* Sidebar links */
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 300px 1fr;
}
.content-area.with-sidebar.sidebar-left .homepage-sidebar {
order: 1;
}
.content-area.with-sidebar.sidebar-left .main-content {
order: 2;
}
/* Entfernt das Sticky-Verhalten der Sidebar komplett */
.homepage-sidebar {
position: relative !important;
top: auto !important;
background: var(--card-background, #1e2029);
border-radius: 8px;
padding: 20px;
overflow-y: auto;
max-height: calc(200vh - 10vh);
}
/* Sidebar Sections - Bereiche innerhalb der Sidebar */
.homepage-sidebar .sidebar-section {
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar .sidebar-section:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
/* Spezielle Styling für bestimmte Bereiche */
.homepage-sidebar .sidebar-top {
border-bottom: 2px solid var(--primary-accent, #00d4ff);
}
.homepage-sidebar .sidebar-bottom {
padding-top: 20px;
border-top: 2px solid var(--primary-accent, #00d4ff);
border-bottom: none;
}
.homepage-sidebar .widget {
margin-bottom: 20px;
}
.homepage-sidebar .widget:last-child {
margin-bottom: 0;
}
.homepage-sidebar .widget-title {
font-size: 1.2rem;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-accent, #00d4ff);
color: var(--primary-accent, #00d4ff);
}
.homepage-sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}
.homepage-sidebar ul li {
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar ul li:last-child {
border-bottom: none;
}
.homepage-sidebar a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.homepage-sidebar a:hover {
color: var(--primary-accent, #00d4ff);
}
/* Mobile: Sidebar unter Content */
@media (max-width: 768px) {
.content-area.with-sidebar.sidebar-right,
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 1fr;
}
.content-area.with-sidebar .homepage-sidebar {
order: 3 !important; /* Immer unten auf mobilen Geräten */
position: relative;
top: 0;
max-height: none;
}
.content-area.with-sidebar .main-content {
order: 1 !important;
}
}
/* Dark Mode Anpassungen */
body.dark-mode .homepage-sidebar {
background: #1e1e1e;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.dark-mode .homepage-sidebar ul li {
border-bottom-color: rgba(255, 255, 255, 0.1);
}
/* Light Mode Anpassungen */
body.light-mode .homepage-sidebar {
background: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .sidebar-section {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar ul li {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .widget-title {
color: var(--primary-accent, #00d4ff);
}
/* Scrollbar Styling für Sidebar */
.homepage-sidebar::-webkit-scrollbar {
width: 6px;
}
.homepage-sidebar::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb {
background: var(--primary-accent, #00d4ff);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb:hover {
background: var(--primary-accent-hover, #00b8e6);
}
</style>
<?php get_footer(); ?>

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@
* - Social Media * - Social Media
* - Footer * - Footer
* - Login * - Login
* - Sidebar
* - Import/Export * - Import/Export
*/ */
@@ -198,7 +199,47 @@ function minecraft_modern_customize_register( $wp_customize ) {
// ========================================================================= // =========================================================================
// === 3. SOCIAL MEDIA ===================================================== // === 3. SIDEBAR EINSTELLUNGEN ============================================
// =========================================================================
$wp_customize->add_section( 'sidebar_settings', array(
'title' => 'Sidebar Einstellungen',
'priority' => 35,
'description' => 'Konfiguriere die Sidebar auf der Startseite.',
) );
// Sidebar aktivieren
$wp_customize->add_setting( 'homepage_sidebar_enabled', array(
'default' => false,
'sanitize_callback' => 'wp_validate_boolean',
) );
$wp_customize->add_control( 'homepage_sidebar_enabled', array(
'label' => 'Sidebar auf Startseite aktivieren',
'description' => 'Zeigt eine Sidebar neben dem Hauptinhalt an.',
'section' => 'sidebar_settings',
'settings' => 'homepage_sidebar_enabled',
'type' => 'checkbox',
) );
// Sidebar Position
$wp_customize->add_setting( 'homepage_sidebar_position', array(
'default' => 'right',
'sanitize_callback' => 'sanitize_key',
) );
$wp_customize->add_control( 'homepage_sidebar_position', array(
'label' => 'Sidebar Position',
'section' => 'sidebar_settings',
'settings' => 'homepage_sidebar_position',
'type' => 'select',
'choices' => array(
'left' => 'Links',
'right' => 'Rechts',
),
) );
// =========================================================================
// === 4. SOCIAL MEDIA =====================================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) ); $wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
@@ -212,7 +253,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
// ========================================================================= // =========================================================================
// === 4. FOOTER-BEREICH ================================================== // === 5. FOOTER-BEREICH ==================================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) ); $wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
@@ -241,7 +282,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
// ========================================================================= // =========================================================================
// === 5. ZUSÄTZLICHE FUNKTIONEN ========================================== // === 6. ZUSÄTZLICHE FUNKTIONEN ==========================================
// ========================================================================= // =========================================================================
// --- Sektion: FAQ Einstellungen --- // --- Sektion: FAQ Einstellungen ---
@@ -251,7 +292,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox', 'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
) ); ) );
// --- Sektion: Team Einstellungen --- // --- Sektion: Team Einstellungen ---
$wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) ); $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_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
$wp_customize->add_control( 'team_enabled', array( $wp_customize->add_control( 'team_enabled', array(
@@ -259,7 +300,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
) ); ) );
// ========================================================================= // =========================================================================
// === 6. LOGIN-BEREICH ==================================================== // === 7. LOGIN-BEREICH ====================================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'login_settings', array( $wp_customize->add_section( 'login_settings', array(
@@ -321,7 +362,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
) ); ) );
// ========================================================================= // =========================================================================
// === 7. EXPORT / IMPORT SECTION ========================================= // === 8. EXPORT / IMPORT SECTION =========================================
// ========================================================================= // =========================================================================
$wp_customize->add_section( 'theme_mods_import_export', array( $wp_customize->add_section( 'theme_mods_import_export', array(

View File

@@ -5,8 +5,23 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; exit;
} }
// === ZENTRALE VERSIONSKONSTANTE === // === THEME VERSION AUTOMATISCH AUS style.css LADEN (PARENT THEME PRIORITÄT) ===
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.6' ); function minecraft_modern_get_theme_version() {
// Holt das aktuell aktive Theme (child oder parent)
$theme = wp_get_theme();
// Wenn ein Child-Theme aktiv ist und ein Parent vorhanden ist, nutze die Parent-Version
$parent = $theme->parent();
if ( $parent && $parent->exists() ) {
$parent_version = $parent->get( 'Version' );
if ( ! empty( $parent_version ) ) {
return $parent_version;
}
}
// Fallback: Version des aktuell aktiven Themes (wenn kein Parent existiert oder Parent keine Version hat)
return $theme->get( 'Version' );
}
// === THEME UPDATE NOTIFICATION SYSTEM === // === THEME UPDATE NOTIFICATION SYSTEM ===
@@ -34,7 +49,10 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
if ( false === $release_info ) { if ( false === $release_info ) {
// Timeout auf 10 Sekunden erhöht für langsame Verbindungen // Timeout auf 10 Sekunden erhöht für langsame Verbindungen
$response = wp_remote_get( 'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest', array( 'timeout' => 10 ) ); $response = wp_remote_get(
'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest',
array( 'timeout' => 10 )
);
if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) { if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) {
$body = wp_remote_retrieve_body( $response ); $body = wp_remote_retrieve_body( $response );
@@ -54,7 +72,7 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : '' 'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : ''
); );
// Cache für 6 Stunden (kannst du anpassen) // Cache für 6 Stunden
set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS ); set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS );
} else { } else {
// Fehlerhafte Daten leer cachen // Fehlerhafte Daten leer cachen
@@ -69,13 +87,13 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
return $release_info; return $release_info;
} }
// Benachrichtigung im Admin-Bereich // === BENACHRICHTIGUNG IM ADMIN-BEREICH ===
function minecraft_modern_show_update_notification() { function minecraft_modern_show_update_notification() {
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) { if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
return; return;
} }
$current_version = MINECRAFT_MODERN_THEME_VERSION; $current_version = minecraft_modern_get_theme_version();
$latest_release = minecraft_modern_get_latest_release_info(); $latest_release = minecraft_modern_get_latest_release_info();
if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) { if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) {
@@ -105,7 +123,7 @@ function minecraft_modern_show_update_notification() {
} }
add_action( 'admin_notices', 'minecraft_modern_show_update_notification' ); add_action( 'admin_notices', 'minecraft_modern_show_update_notification' );
// Dashboard Widget // === DASHBOARD WIDGET ===
function minecraft_modern_add_dashboard_widget() { function minecraft_modern_add_dashboard_widget() {
wp_add_dashboard_widget( wp_add_dashboard_widget(
'minecraft_modern_update_widget', 'minecraft_modern_update_widget',
@@ -116,7 +134,7 @@ function minecraft_modern_add_dashboard_widget() {
add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' ); add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' );
function minecraft_modern_update_widget_function() { function minecraft_modern_update_widget_function() {
$current_version = MINECRAFT_MODERN_THEME_VERSION; $current_version = minecraft_modern_get_theme_version();
$latest_release = minecraft_modern_get_latest_release_info(); $latest_release = minecraft_modern_get_latest_release_info();
echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>'; echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>';
@@ -125,18 +143,18 @@ function minecraft_modern_update_widget_function() {
echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>'; echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>';
if ( version_compare( $current_version, $latest_release['version'], '<' ) ) { if ( version_compare( $current_version, $latest_release['version'], '<' ) ) {
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color: #d63638;">' . __( 'Update Available', 'minecraft-modern-theme' ) . '</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>'; echo '<p><a href="' . esc_url( $latest_release['download_url'] ) . '" class="button button-primary" target="_blank">' . __( 'Download Update', 'minecraft-modern-theme' ) . '</a></p>';
} else { } else {
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color: #46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>'; echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>';
} }
} else { } else {
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>'; echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>';
} }
// Link für "Jetzt prüfen" hinzugefügt // Link für "Jetzt prüfen"
$refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' ); $refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' );
echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></p>'; echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></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>'; 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

@@ -4,12 +4,223 @@ Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
Author: M_Viper Author: M_Viper
Description: Ein modernes Gaming-Theme mit konfigurierbarem Header-Slider. Description: Ein modernes Gaming-Theme mit konfigurierbarem Header-Slider.
Author URI: https://M-Viper.de Author URI: https://M-Viper.de
Version: 1.6 Version: 1.8
License: GNU General Public License v2 or later License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minecraft-modern-theme Text Domain: minecraft-modern-theme
*/ */
/* === FRONT-PAGE WIDGET CSS === */
.homepage-sidebar .widget {
margin-bottom: 20px;
}
.homepage-sidebar .widget:last-child {
margin-bottom: 0;
}
.homepage-sidebar .widget-title {
font-size: 1.2rem;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-accent, #00d4ff);
color: var(--primary-accent, #00d4ff);
}
.homepage-sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}
.homepage-sidebar ul li {
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar ul li:last-child {
border-bottom: none;
}
.homepage-sidebar a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.homepage-sidebar a:hover {
color: var(--primary-accent, #00d4ff);
}
/* === FRONT-PAGE SIDEBAR LAYOUT === */
.content-area .main-content {
width: 100%;
}
.content-area.with-sidebar {
display: grid;
gap: 30px;
align-items: start;
}
.content-area.with-sidebar.sidebar-right {
grid-template-columns: 1fr 300px;
}
.content-area.with-sidebar.sidebar-right .main-content {
order: 1;
}
.content-area.with-sidebar.sidebar-right .homepage-sidebar {
order: 2;
}
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 300px 1fr;
}
.content-area.with-sidebar.sidebar-left .homepage-sidebar {
order: 1;
}
.content-area.with-sidebar.sidebar-left .main-content {
order: 2;
}
.homepage-sidebar {
position: relative !important;
top: auto !important;
background: var(--card-background, #1e2029);
border-radius: 8px;
padding: 20px;
overflow-y: auto;
max-height: calc(200vh - 10vh);
}
.homepage-sidebar .sidebar-section {
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar .sidebar-section:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.homepage-sidebar .sidebar-top {
border-bottom: 2px solid var(--primary-accent, #00d4ff);
}
.homepage-sidebar .sidebar-bottom {
padding-top: 20px;
border-top: 2px solid var(--primary-accent, #00d4ff);
border-bottom: none;
}
.homepage-sidebar .widget {
margin-bottom: 20px;
}
.homepage-sidebar .widget:last-child {
margin-bottom: 0;
}
.homepage-sidebar .widget-title {
font-size: 1.2rem;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-accent, #00d4ff);
color: var(--primary-accent, #00d4ff);
}
.homepage-sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}
.homepage-sidebar ul li {
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar ul li:last-child {
border-bottom: none;
}
.homepage-sidebar a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.homepage-sidebar a:hover {
color: var(--primary-accent, #00d4ff);
}
@media (max-width: 768px) {
.content-area.with-sidebar.sidebar-right,
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 1fr;
}
.content-area.with-sidebar .homepage-sidebar {
order: 3 !important;
position: relative;
top: 0;
max-height: none;
}
.content-area.with-sidebar .main-content {
order: 1 !important;
}
}
body.dark-mode .homepage-sidebar {
background: #1e1e1e;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.dark-mode .homepage-sidebar ul li {
border-bottom-color: rgba(255, 255, 255, 0.1);
}
body.light-mode .homepage-sidebar {
background: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .sidebar-section {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar ul li {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .widget-title {
color: var(--primary-accent, #00d4ff);
}
.homepage-sidebar::-webkit-scrollbar {
width: 6px;
}
.homepage-sidebar::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb {
background: var(--primary-accent, #00d4ff);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb:hover {
background: var(--primary-accent-hover, #00b8e6);
}
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap');
/* === DARK / LIGHT MODE VARIABLEN === */ /* === DARK / LIGHT MODE VARIABLEN === */
@@ -91,11 +302,6 @@ a:hover { color: #fff; }
gap: 40px; /* Flexiblerer Abstand */ 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 { .site-branding {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -1283,4 +1489,5 @@ body.home-title-hidden .site-main .page-header {
height: 120px; height: 120px;
margin-top: -40px; margin-top: -40px;
} }
} }