Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ae3795337e | |||
| 43be3dd783 | |||
| afcabb0f10 | |||
| 99e9d76c97 | |||
| 91586b8cee | |||
| 156030f70d | |||
| 603cc0a430 | |||
| 23b93ec177 | |||
| 839b1a2e85 | |||
| b0d7f44d9a | |||
| fab5f1464c | |||
| 6b8301bff5 | |||
| a316e6a6dd | |||
| d334704927 | |||
| 5004c0072c | |||
| 250d00aa20 | |||
| 519c7c6b52 | |||
| 8499b29174 | |||
| b62c52cfad | |||
| 57e758353a | |||
| ae4ec1dc30 | |||
| aabc4e37e5 | |||
| d5baf0cadb | |||
| 4b28dc465d | |||
| 9a36bd94d0 | |||
| 33a1fe6848 | |||
| f1eabc1c9d | |||
| ad1ff1843b | |||
| 9fe45108d8 | |||
| f315469c41 | |||
| 5987417f36 | |||
| 79b798d5fe | |||
| ea1331c266 | |||
| 903333cac3 | |||
| 446e08dc91 | |||
| 231cf8fc6c |
@@ -1,42 +1,74 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Exit if accessed directly.
|
// Exit if accessed directly.
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// === 1. Stylesheets korrekt laden ===
|
/**
|
||||||
function child_theme_enqueue_styles() {
|
* =============================================================================
|
||||||
// Lädt das Stylesheet des Parent Themes
|
* HAUPTFUNKTION: Stylesheets korrekt laden
|
||||||
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
|
* =============================================================================
|
||||||
|
*
|
||||||
// Lädt das Stylesheet des Child Themes (abhängig vom Parent-Style)
|
* Diese Funktion lädt das Stylesheet des Parents zuerst.
|
||||||
wp_enqueue_style( 'child-style',
|
* Danach wird das Stylesheet des Childs geladen.
|
||||||
get_stylesheet_directory_uri() . '/style.css',
|
* So können CSS-Regeln im Child Theme das Parent Theme gezielt überschreiben.
|
||||||
array( 'parent-style' ),
|
*/
|
||||||
wp_get_theme()->get('Version')
|
function minecraft_modern_child_enqueue_styles() {
|
||||||
);
|
// 1. Das Stylesheet des Parent Themes laden
|
||||||
}
|
// get_template_directory_uri() zeigt auf den Ordner des Parent Themes.
|
||||||
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );
|
// Der Handle 'minecraft-modern-style' sollte exakt dem im Parent übereinstimmen.
|
||||||
|
$parent_style = 'minecraft-modern-style';
|
||||||
|
|
||||||
// === 2. Nur das FAQ-Skript austauschen ===
|
wp_enqueue_style(
|
||||||
function child_theme_swap_faq_script() {
|
$parent_style,
|
||||||
// Entfernt das Skript, das das Parent Theme geladen hat
|
get_template_directory_uri() . '/style.css',
|
||||||
wp_deregister_script( 'faq-accordion-script' );
|
array(),
|
||||||
|
wp_get_theme( get_template() )->get( 'Version' ) // WICHTIG: Wir nutzen die Version des Parents
|
||||||
// Lädt Ihr neues, verbessertes Skript aus dem Child Theme
|
);
|
||||||
// Wir verwenden den gleichen Namen ('Handle'), um Konflikte zu vermeiden
|
|
||||||
wp_enqueue_script(
|
// 2. Das Stylesheet des Child Themes laden
|
||||||
'faq-accordion-script', // Gleicher Name wie im Parent Theme
|
// get_stylesheet_directory_uri() zeigt auf den Ordner des Child Themes.
|
||||||
get_stylesheet_directory_uri() . '/js/faq-accordion.js', // Pfad zur neuen JS-Datei
|
// Die Abhängigkeit 'parent-style' stellt sicher, dass es NACH dem Parent geladen wird.
|
||||||
array( 'jquery' ),
|
wp_enqueue_style(
|
||||||
'1.0',
|
'minecraft-modern-child-style',
|
||||||
true
|
get_stylesheet_directory_uri() . '/style.css',
|
||||||
);
|
array( $parent_style ),
|
||||||
}
|
wp_get_theme()->get( 'Version' ) // Die Version des Childs (für Cache-Reset)
|
||||||
// Diese Funktion wird mit einer höheren Priorität (20) ausgeführt,
|
);
|
||||||
// also NACHDEM das Parent Theme sein Skript geladen hat.
|
}
|
||||||
add_action( 'wp_enqueue_scripts', 'child_theme_swap_faq_script', 20 );
|
add_action( 'wp_enqueue_scripts', 'minecraft_modern_child_enqueue_styles' );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* =============================================================================
|
||||||
|
* (OPTIONAL) Beispiel: Ein Skript des Parent Themes überschreiben
|
||||||
|
* =============================================================================
|
||||||
|
*
|
||||||
|
* Falls du die Logik des Sliders (z.B. die slider-init.js) im Child Theme
|
||||||
|
* anpassen möchtest, könntest du diese Technik nutzen.
|
||||||
|
* Dies ist NUR NOTWENDIG, wenn du Änderungen am JavaScript des Sliders vornehmen willst.
|
||||||
|
*
|
||||||
|
* Um dies zu aktivieren, entferne die Slashs (/) am Anfang und Ende dieses Blocks.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
function minecraft_modern_child_swap_faq_script() {
|
||||||
|
// Entfernt das Skript, das vom Parent Theme mit dem Handle 'faq-accordion-script' registriert wurde.
|
||||||
|
wp_deregister_script( 'faq-accordion-script' );
|
||||||
|
|
||||||
|
// Lädt dein neues Skript aus dem Child Theme.
|
||||||
|
// Wir verwenden denselben Namen ('Handle'), um WordPress klar zu machen,
|
||||||
|
// dass dieses Skript das Original ersetzt.
|
||||||
|
wp_enqueue_script(
|
||||||
|
'faq-accordion-script', // Derselbe Handle wie im Parent Theme
|
||||||
|
get_stylesheet_directory_uri() . '/js/faq-accordion.js', // Pfad zur neuen JS-Datei im Child Theme
|
||||||
|
array( 'jquery' ), // Abhängigkeiten (hier jQuery)
|
||||||
|
'1.0', // Version deines Skripts
|
||||||
|
true // Im Footer laden
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Diese Funktion wird mit einer höheren Priorität (20) ausgeführt,
|
||||||
|
// also NACHDEM das Parent Theme sein Skript geladen hat.
|
||||||
|
add_action( 'wp_enqueue_scripts', 'minecraft_modern_child_swap_faq_script', 20 );
|
||||||
|
*/
|
||||||
?>
|
?>
|
||||||
@@ -1,40 +1,55 @@
|
|||||||
/*
|
/*
|
||||||
Theme Name: Minecraft Modern Theme Child
|
Theme Name: Minecraft Modern Theme Child
|
||||||
Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
|
Theme URI: https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme
|
||||||
Description: Ein Child Theme für das Minecraft Modern Theme.
|
Description: Ein Child Theme für das Minecraft Modern Theme.
|
||||||
Author: M_Viper
|
Author: M_Viper
|
||||||
Author URI: https://M-Viper.de
|
Author URI: https://M-Viper.de
|
||||||
Template: minecraft-modern-theme
|
Template: Minecraft-Modern-Theme
|
||||||
Version: 1.0.0
|
Version: 1.1.0
|
||||||
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-child
|
Text Domain: minecraft-modern-theme-child
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* =Hier kommen Ihre CSS-Anpassungen hin
|
/* =Hier kommen Ihre CSS-Anpassungen hin
|
||||||
-------------------------------------------------------------- */
|
-------------------------------------------------------------- */
|
||||||
|
|
||||||
/* Kopieren Sie Ihre geänderten CSS-Regeln hierhin.
|
/* Kopieren Sie Ihre geänderten CSS-Regeln hierhin.
|
||||||
Zum Beispiel die neuen Regeln für die FAQ-Tabs:
|
Zum Beispiel die neuen Regeln für die FAQ-Tabs:
|
||||||
*/
|
*/
|
||||||
.faq-tab-content-container {
|
.faq-tab-content-container {
|
||||||
display: grid; /* Wichtig: Erzeugt ein Gitter-Layout */
|
display: grid; /* Wichtig: Erzeugt ein Gitter-Layout */
|
||||||
/* Alle direkten Kinder (.faq-tab-pane) werden automatisch auf die gleiche Höhe gesetzt */
|
/* Alle direkten Kinder (.faq-tab-pane) werden automatisch auf die gleiche Höhe gesetzt */
|
||||||
}
|
}
|
||||||
|
|
||||||
.faq-tab-pane {
|
.faq-tab-pane {
|
||||||
/* Grid-Item-Styling */
|
/* Grid-Item-Styling */
|
||||||
grid-area: 1 / 1 / 2 / 2; /* Alle Panes belegen dieselbe Gitterzelle */
|
grid-area: 1 / 1 / 2 / 2; /* Alle Panes belegen dieselbe Gitterzelle */
|
||||||
|
|
||||||
/* Visuelles Ein- und Ausblenden */
|
/* Visuelles Ein- und Ausblenden */
|
||||||
opacity: 0; /* Standardmäßig unsichtbar */
|
opacity: 0; /* Standardmäßig unsichtbar */
|
||||||
pointer-events: none; /* Nicht klickbar, wenn unsichtbar */
|
pointer-events: none; /* Nicht klickbar, wenn unsichtbar */
|
||||||
transition: opacity 0.4s ease-in-out;
|
transition: opacity 0.4s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.faq-tab-pane.active {
|
.faq-tab-pane.active {
|
||||||
opacity: 1; /* Sichtbar machen */
|
opacity: 1; /* Sichtbar machen */
|
||||||
pointer-events: auto; /* Wieder klickbar machen */
|
pointer-events: auto; /* Wieder klickbar machen */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===================================================================
|
||||||
|
LAYOUT-SHIFT-FIX: Slider verstecken, bis er initialisiert ist
|
||||||
|
=================================================================== */
|
||||||
|
.hero-slider {
|
||||||
|
/* Verstecke den Slider initial, um ein "Zusammenschnappen" zu verhindern */
|
||||||
|
opacity: 0;
|
||||||
|
/* Füge einen sanften Übergangseffekt für das Einblenden hinzu */
|
||||||
|
transition: opacity 0.4s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Diese Klasse wird vom JavaScript hinzugefügt, wenn der Slider bereit ist */
|
||||||
|
.hero-slider.swiper-initialized {
|
||||||
|
/* Mache den Slider sichtbar */
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
/* Fügen Sie hier zukünftig weiteres eigenes CSS hinzu */
|
/* Fügen Sie hier zukünftig weiteres eigenes CSS hinzu */
|
||||||
47
Minecraft-Modern-Theme/archive-team.php
Normal file
47
Minecraft-Modern-Theme/archive-team.php
Normal 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(); ?>
|
||||||
@@ -1,74 +1,84 @@
|
|||||||
<footer id="colophon" class="site-footer">
|
<footer id="colophon" class="site-footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="footer-widgets-container">
|
<!-- 1. OBERER BEREICH: Widgets -->
|
||||||
<div class="footer-widgets">
|
<div class="footer-widgets">
|
||||||
<?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
|
<?php if ( is_active_sidebar( 'footer-1' ) ) : ?>
|
||||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-1' ); ?></div>
|
<div class="footer-widget"><?php dynamic_sidebar( 'footer-1' ); ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
|
<?php if ( is_active_sidebar( 'footer-2' ) ) : ?>
|
||||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-2' ); ?></div>
|
<div class="footer-widget"><?php dynamic_sidebar( 'footer-2' ); ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
|
<?php if ( is_active_sidebar( 'footer-3' ) ) : ?>
|
||||||
<div class="footer-widget"><?php dynamic_sidebar( 'footer-3' ); ?></div>
|
<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', '© ' . 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; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<?php if ( has_nav_menu( 'footer' ) ) : ?>
|
|
||||||
<nav class="footer-navigation">
|
|
||||||
<?php
|
|
||||||
wp_nav_menu(
|
|
||||||
array(
|
|
||||||
'theme_location' => 'footer',
|
|
||||||
'menu_class' => 'footer-menu',
|
|
||||||
'container' => false,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
</nav>
|
|
||||||
<?php endif; ?>
|
|
||||||
<div class="site-info">
|
|
||||||
<?php
|
|
||||||
// Den Copyright-Text aus dem Customizer holen
|
|
||||||
$copyright_text = get_theme_mod( 'footer_copyright', '© ' . date('Y') . ' ' . get_bloginfo('name') );
|
|
||||||
|
|
||||||
// Prüfen, ob der Credit angezeigt werden soll
|
|
||||||
if ( get_theme_mod('show_footer_credit', true) ) {
|
|
||||||
// Wenn ja, den Credit-Text mit einem Trennzeichen anhängen
|
|
||||||
$full_footer_text = $copyright_text . ' | <span class="footer-credit">Minecraft Theme Erstellt von M_Viper 2025</span>';
|
|
||||||
} else {
|
|
||||||
// Wenn nein, nur den Copyright-Text verwenden
|
|
||||||
$full_footer_text = $copyright_text;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Den kompletten Text ausgeben
|
|
||||||
echo '<p>' . wp_kses_post( $full_footer_text ) . '</p>';
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- NEU: Impressum & Datenschutz Links -->
|
<div class="footer-right-group">
|
||||||
<div class="footer-legal-links">
|
<!-- Impressum & Datenschutz -->
|
||||||
<?php
|
<div class="footer-legal-links">
|
||||||
$impressum_url = get_theme_mod('footer_impressum_url');
|
<?php
|
||||||
$datenschutz_url = get_theme_mod('footer_datenschutz_url');
|
$impressum_url = get_theme_mod('footer_impressum_url');
|
||||||
$links = array();
|
$datenschutz_url = get_theme_mod('footer_datenschutz_url');
|
||||||
|
$links = array();
|
||||||
|
|
||||||
if (!empty($impressum_url)) {
|
if (!empty($impressum_url)) {
|
||||||
$links[] = '<a href="' . esc_url($impressum_url) . '">Impressum</a>';
|
$links[] = '<a href="' . esc_url($impressum_url) . '"><i class="fas fa-info-circle"></i> Impressum</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($datenschutz_url)) {
|
if (!empty($datenschutz_url)) {
|
||||||
$links[] = '<a href="' . esc_url($datenschutz_url) . '">Datenschutz</a>';
|
$links[] = '<a href="' . esc_url($datenschutz_url) . '"><i class="fas fa-shield-alt"></i> Datenschutz</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nur anzeigen, wenn mindestens ein Link vorhanden ist
|
if (!empty($links)) {
|
||||||
if (!empty($links)) {
|
echo implode('', $links); // Kein Trennzeichen mehr, da wir Icons haben
|
||||||
echo implode(' | ', $links);
|
}
|
||||||
}
|
?>
|
||||||
?>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
</div> <!-- Ende footer-bottom-bar -->
|
||||||
|
</div> <!-- Ende Container -->
|
||||||
|
|
||||||
<!-- Ovaler Dark / Light Mode Toggle mit Sonne & Mond -->
|
<!-- THEME TOGGLE (Fixiert unten rechts) -->
|
||||||
<button class="theme-toggle" aria-label="Dark/Light Mode umschalten" title="Dark / Light Mode">
|
<button class="theme-toggle" aria-label="Dark/Light Mode umschalten" title="Dark / Light Mode">
|
||||||
<div class="theme-toggle-icons">
|
<div class="theme-toggle-icons">
|
||||||
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
|||||||
@@ -1,92 +1,135 @@
|
|||||||
<?php get_header(); ?>
|
<?php get_header(); ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ( get_theme_mod('slider_enabled', false) ) :
|
// =====================================================
|
||||||
?>
|
// HERO SLIDER ODER HERO SECTION
|
||||||
<section class="hero-slider swiper-container">
|
// =====================================================
|
||||||
<div class="swiper-wrapper">
|
if ( get_theme_mod('slider_enabled', false) ) :
|
||||||
<?php
|
?>
|
||||||
for ($i = 1; $i <= 5; $i++) :
|
<section class="hero-slider swiper-container">
|
||||||
$image_url = get_theme_mod('slider_image_' . $i);
|
<div class="swiper-wrapper">
|
||||||
if ($image_url) :
|
<?php
|
||||||
$title = get_theme_mod('slider_title_' . $i);
|
for ( $i = 1; $i <= 5; $i++ ) :
|
||||||
$subtitle = get_theme_mod('slider_subtitle_' . $i);
|
$image_url = get_theme_mod( 'slider_image_' . $i );
|
||||||
?>
|
if ( $image_url ) :
|
||||||
<div class="swiper-slide" style="background-image: url('<?php echo esc_url($image_url); ?>');">
|
$title = get_theme_mod( 'slider_title_' . $i );
|
||||||
<div class="slider-content">
|
$subtitle = get_theme_mod( 'slider_subtitle_' . $i );
|
||||||
<?php if ($title) : ?>
|
?>
|
||||||
<h2 class="slider-title"><?php echo esc_html($title); ?></h2>
|
<div class="swiper-slide" style="background-image: url('<?php echo esc_url( $image_url ); ?>');">
|
||||||
<?php endif; ?>
|
<div class="slider-content">
|
||||||
<?php if ($subtitle) : ?>
|
<?php if ( $title ) : ?>
|
||||||
<p class="slider-subtitle"><?php echo esc_html($subtitle); ?></p>
|
<h2 class="slider-title"><?php echo esc_html( $title ); ?></h2>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
</div>
|
<?php if ( $subtitle ) : ?>
|
||||||
<?php
|
<p class="slider-subtitle"><?php echo esc_html( $subtitle ); ?></p>
|
||||||
endif;
|
<?php endif; ?>
|
||||||
endfor;
|
</div>
|
||||||
?>
|
</div>
|
||||||
</div>
|
<?php
|
||||||
|
endif;
|
||||||
<!-- Nur anzeigen, wenn die Paginierung NICHT ausgeblendet ist -->
|
endfor;
|
||||||
<?php if ( ! get_theme_mod('slider_hide_pagination', false) ) : ?>
|
?>
|
||||||
<div class="swiper-pagination"></div>
|
</div>
|
||||||
<?php endif; ?>
|
|
||||||
|
<?php if ( ! get_theme_mod( 'slider_hide_pagination', false ) ) : ?>
|
||||||
<!-- Nur anzeigen, wenn die Pfeile NICHT ausgeblendet sind -->
|
<div class="swiper-pagination"></div>
|
||||||
<?php if ( ! get_theme_mod('slider_hide_arrows', false) ) : ?>
|
<?php endif; ?>
|
||||||
<div class="swiper-button-prev"></div>
|
|
||||||
<div class="swiper-button-next"></div>
|
<?php if ( ! get_theme_mod( 'slider_hide_arrows', false ) ) : ?>
|
||||||
<?php endif; ?>
|
<div class="swiper-button-prev"></div>
|
||||||
|
<div class="swiper-button-next"></div>
|
||||||
</section>
|
<?php endif; ?>
|
||||||
<?php else : ?>
|
</section>
|
||||||
<?php
|
|
||||||
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
<!-- ================================================= -->
|
||||||
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
<!-- ANNOUNCEMENT ANKER (unter Slider, ohne Scroll-Bug) -->
|
||||||
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
<!-- ================================================= -->
|
||||||
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
<div id="mm-announcement-anchor"></div>
|
||||||
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
|
||||||
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
<?php else : ?>
|
||||||
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
|
||||||
?>
|
<?php
|
||||||
<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) . "')" : ''; ?>">
|
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
||||||
<div class="container">
|
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
||||||
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
|
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
||||||
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
|
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
||||||
<div class="hero-buttons">
|
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
||||||
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
|
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
||||||
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
|
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
||||||
</div>
|
?>
|
||||||
</div>
|
|
||||||
</section>
|
<section class="hero-section"
|
||||||
<?php endif; ?>
|
style="<?php
|
||||||
|
echo $hero_bg
|
||||||
<main id="primary" class="site-main">
|
? "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="content-area">
|
?>">
|
||||||
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
<div class="container">
|
||||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
|
<h1 class="hero-title"><?php echo esc_html( $hero_title ); ?></h1>
|
||||||
<?php if ( has_post_thumbnail() ) : ?>
|
<p class="hero-subtitle"><?php echo esc_html( $hero_subtitle ); ?></p>
|
||||||
<div class="post-thumbnail">
|
|
||||||
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
<div class="hero-buttons">
|
||||||
</div>
|
<a href="<?php echo esc_url( $btn1_url ); ?>" class="hero-button-1">
|
||||||
<?php endif; ?>
|
<?php echo esc_html( $btn1_text ); ?>
|
||||||
<div class="post-content">
|
</a>
|
||||||
<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
<a href="<?php echo esc_url( $btn2_url ); ?>" class="hero-button-2">
|
||||||
<!-- =================================================================== -->
|
<?php echo esc_html( $btn2_text ); ?>
|
||||||
<!-- === HIER IST DIE ÄNDERUNG: Vollen Inhalt anstelle des Auszugs === -->
|
</a>
|
||||||
<!-- =================================================================== -->
|
</div>
|
||||||
<div class="post-full-content">
|
</div>
|
||||||
<?php the_content(); ?>
|
</section>
|
||||||
</div>
|
|
||||||
</div>
|
<!-- ================================================= -->
|
||||||
</article>
|
<!-- ANNOUNCEMENT ANKER (unter Hero, ohne Scroll-Bug) -->
|
||||||
<?php endwhile; else : ?>
|
<!-- ================================================= -->
|
||||||
<p><?php _e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
|
<div id="mm-announcement-anchor"></div>
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
</main>
|
<!-- ===================================================== -->
|
||||||
|
<!-- MAIN CONTENT -->
|
||||||
<?php get_footer(); ?>
|
<!-- ===================================================== -->
|
||||||
|
<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
@@ -1,65 +1,79 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html <?php language_attributes(); ?>>
|
<html <?php language_attributes(); ?>>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<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">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
||||||
<?php wp_head(); ?>
|
<?php wp_head(); ?>
|
||||||
</head>
|
</head>
|
||||||
<body <?php body_class(); ?>>
|
<body <?php body_class(); ?>>
|
||||||
<header id="masthead" class="site-header">
|
<?php wp_body_open(); ?>
|
||||||
<div class="container">
|
|
||||||
<div class="header-main">
|
<header id="masthead" class="site-header">
|
||||||
<div class="site-branding">
|
<div class="container">
|
||||||
<?php
|
<div class="header-main">
|
||||||
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
|
<div class="site-branding">
|
||||||
the_custom_logo();
|
<?php
|
||||||
}
|
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
|
||||||
?>
|
the_custom_logo();
|
||||||
<?php
|
}
|
||||||
|
?>
|
||||||
if ( is_front_page() && is_home() ) :
|
|
||||||
?>
|
<?php
|
||||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
if ( is_front_page() && is_home() ) :
|
||||||
<?php else : ?>
|
?>
|
||||||
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||||
<?php endif; ?>
|
<?php else : ?>
|
||||||
</div>
|
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
||||||
<nav id="site-navigation" class="main-navigation">
|
<?php endif; ?>
|
||||||
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false ) ); ?>
|
</div>
|
||||||
</nav>
|
|
||||||
<div class="header-info">
|
<!-- NAVIGATION START -->
|
||||||
<div class="social-links">
|
<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e('Hauptmenü','minecraft-modern-theme'); ?>">
|
||||||
<?php
|
<!-- Mobile Toggle Button -->
|
||||||
// Array mit den Social-Media-Plattformen und ihren Font Awesome Klassen
|
<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false">
|
||||||
$social_icons = array(
|
<i class="fas fa-bars"></i>
|
||||||
'discord' => 'fab fa-discord',
|
</button>
|
||||||
'youtube' => 'fab fa-youtube',
|
|
||||||
'twitter' => 'fab fa-x-twitter', // Neues Icon für Twitter/X
|
<?php
|
||||||
'facebook' => 'fab fa-facebook-f',
|
wp_nav_menu( array(
|
||||||
'instagram' => 'fab fa-instagram',
|
'theme_location' => 'primary',
|
||||||
'tiktok' => 'fab fa-tiktok',
|
'container' => false,
|
||||||
'twitch' => 'fab fa-twitch',
|
'menu_class' => 'primary-menu',
|
||||||
'steam' => 'fab fa-steam',
|
'fallback_cb' => false,
|
||||||
'github' => 'fab fa-github',
|
) );
|
||||||
'linkedin' => 'fab fa-linkedin-in',
|
?>
|
||||||
'pinterest' => 'fab fa-pinterest-p',
|
</nav>
|
||||||
'reddit' => 'fab fa-reddit-alien',
|
<!-- NAVIGATION ENDE -->
|
||||||
'teamspeak' => 'fab fa-teamspeak',
|
|
||||||
'spotify' => 'fab fa-spotify'
|
<div class="header-info">
|
||||||
);
|
<div class="social-links">
|
||||||
|
<?php
|
||||||
// Schleife, die alle verfügbaren Icons durchgeht
|
$social_icons = array(
|
||||||
foreach ($social_icons as $key => $class) {
|
'discord' => 'fab fa-discord',
|
||||||
// Prüfen, ob für diese Plattform eine URL im Customizer hinterlegt wurde
|
'youtube' => 'fab fa-youtube',
|
||||||
if (get_theme_mod('social_' . $key)) {
|
'twitter' => 'fab fa-x-twitter',
|
||||||
// Wenn ja, Link und Icon ausgeben
|
'facebook' => 'fab fa-facebook-f',
|
||||||
echo '<a href="' . esc_url(get_theme_mod('social_' . $key)) . '" target="_blank"><i class="' . esc_attr($class) . '"></i></a>';
|
'instagram' => 'fab fa-instagram',
|
||||||
}
|
'tiktok' => 'fab fa-tiktok',
|
||||||
}
|
'twitch' => 'fab fa-twitch',
|
||||||
?>
|
'steam' => 'fab fa-steam',
|
||||||
</div>
|
'github' => 'fab fa-github',
|
||||||
</div>
|
'linkedin' => 'fab fa-linkedin-in',
|
||||||
</div>
|
'pinterest' => 'fab fa-pinterest-p',
|
||||||
</div>
|
'reddit' => 'fab fa-reddit-alien',
|
||||||
</header>
|
'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>
|
||||||
|
|||||||
@@ -1,4 +1,16 @@
|
|||||||
<?php
|
<?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 ) {
|
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',
|
'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_setting( 'header_height', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_control( 'header_height', array(
|
$wp_customize->add_control( 'header_height', array(
|
||||||
'label' => 'Header-Höhe', 'section' => 'header_slider', 'settings' => 'header_height', 'type' => 'select',
|
'label' => 'Header-Höhe', 'section' => 'header_slider', 'settings' => 'header_height', 'type' => 'select',
|
||||||
@@ -84,23 +96,6 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
'label' => 'Paginierung (Punkte) ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_pagination', 'type' => 'checkbox',
|
'label' => 'Paginierung (Punkte) ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_pagination', 'type' => 'checkbox',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// =========================================================================
|
|
||||||
// === NEU: Slider-Effekt-Einstellungen ===================================
|
|
||||||
// =========================================================================
|
|
||||||
|
|
||||||
$wp_customize->add_setting( 'slider_effect', array( 'default' => 'fade', 'sanitize_callback' => 'sanitize_key' ) );
|
|
||||||
$wp_customize->add_control( 'slider_effect', array(
|
|
||||||
'label' => 'Slider-Effekt', 'section' => 'header_slider', 'settings' => 'slider_effect', 'type' => 'select',
|
|
||||||
'choices' => array( 'slide' => 'Horizontales Gleiten', 'fade' => 'Überblenden', 'cube' => 'Würfel-Effekt' ),
|
|
||||||
) );
|
|
||||||
|
|
||||||
$wp_customize->add_setting( 'slider_direction', array( 'default' => 'horizontal', 'sanitize_callback' => 'sanitize_key' ) );
|
|
||||||
$wp_customize->add_control( 'slider_direction', array(
|
|
||||||
'label' => 'Slider-Richtung (nur für "Gleiten")', 'section' => 'header_slider', 'settings' => 'slider_direction', 'type' => 'select',
|
|
||||||
'choices' => array( 'horizontal' => 'Horizontal', 'vertical' => 'Vertikal' ),
|
|
||||||
) );
|
|
||||||
|
|
||||||
|
|
||||||
// --- Sektion: Startseiten-Hero (Fallback) ---
|
// --- Sektion: Startseiten-Hero (Fallback) ---
|
||||||
$wp_customize->add_section( 'hero_section', array(
|
$wp_customize->add_section( 'hero_section', array(
|
||||||
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
|
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
|
||||||
@@ -124,6 +119,19 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
$wp_customize->add_setting( 'hero_button_2_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
$wp_customize->add_setting( 'hero_button_2_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
||||||
$wp_customize->add_control( 'hero_button_2_url', array( 'label' => 'Button 2 URL', 'section' => 'hero_section', 'settings' => 'hero_button_2_url', 'type' => 'url' ) );
|
$wp_customize->add_control( 'hero_button_2_url', array( 'label' => 'Button 2 URL', 'section' => 'hero_section', 'settings' => 'hero_button_2_url', 'type' => 'url' ) );
|
||||||
|
|
||||||
|
// --- Checkbox: Seitentitel auf Startseite verstecken ---
|
||||||
|
$wp_customize->add_setting( 'show_home_title', array(
|
||||||
|
'default' => false,
|
||||||
|
'sanitize_callback' => 'wp_validate_boolean',
|
||||||
|
) );
|
||||||
|
$wp_customize->add_control( 'show_home_title', array(
|
||||||
|
'label' => 'Seitentitel "Home" anzeigen',
|
||||||
|
'description' => 'Aktiviere diese Option, wenn der Titel "Home" über dem Slider/Inhalt angezeigt werden soll.',
|
||||||
|
'section' => 'hero_section',
|
||||||
|
'settings' => 'show_home_title',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
) );
|
||||||
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================
|
// === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================
|
||||||
@@ -135,6 +143,34 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
'priority' => 30,
|
'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
|
// Akzentfarbe
|
||||||
$wp_customize->add_setting( 'primary_accent_color', array( 'default' => '#00d4ff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' ) );
|
$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(
|
$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',
|
'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 ====================================================
|
// === 6. LOGIN-BEREICH ====================================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
@@ -276,6 +319,121 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'input_attrs' => array( 'min' => 2, 'max' => 10, 'step' => 1 ),
|
'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' );
|
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_font = get_theme_mod( 'slider_font_family', 'Raleway' );
|
||||||
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
|
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
|
||||||
$slider_size_setting = get_theme_mod( 'slider_font_size', 'mittel' );
|
$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-Höhe umwandeln
|
||||||
$header_height_value = '300px';
|
$header_height_value = '300px';
|
||||||
@@ -329,10 +487,6 @@ function minecraft_modern_dynamic_css_output() {
|
|||||||
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
|
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =================================================================== */
|
|
||||||
/* === NEU: Trennlinien mit der Akzentfarbe ========================= */
|
|
||||||
/* =================================================================== */
|
|
||||||
|
|
||||||
/* Trennlinie unter dem Header */
|
/* Trennlinie unter dem Header */
|
||||||
.site-header {
|
.site-header {
|
||||||
border-bottom: 4px solid var(--primary-accent);
|
border-bottom: 4px solid var(--primary-accent);
|
||||||
@@ -347,8 +501,48 @@ function minecraft_modern_dynamic_css_output() {
|
|||||||
.site-footer {
|
.site-footer {
|
||||||
border-top: 4px solid var(--primary-accent);
|
border-top: 4px solid var(--primary-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<?php
|
<?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');
|
||||||
125
Minecraft-Modern-Theme/inc/theme-updater.php
Normal file
125
Minecraft-Modern-Theme/inc/theme-updater.php
Normal file
@@ -0,0 +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.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>';
|
||||||
|
}
|
||||||
84
Minecraft-Modern-Theme/js/announcement.js
Normal file
84
Minecraft-Modern-Theme/js/announcement.js
Normal 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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
158
Minecraft-Modern-Theme/js/mm-announcement-admin.js
Normal file
158
Minecraft-Modern-Theme/js/mm-announcement-admin.js
Normal 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);
|
||||||
40
Minecraft-Modern-Theme/js/navigation.js
Normal file
40
Minecraft-Modern-Theme/js/navigation.js
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
( function() {
|
||||||
|
const siteNavigation = document.getElementById( 'site-navigation' );
|
||||||
|
const menuToggle = siteNavigation.querySelector( '.menu-toggle' );
|
||||||
|
|
||||||
|
// Early exit wenn kein Toggle da ist
|
||||||
|
if ( ! menuToggle ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Toggle Klassen hinzufügen (Menü öffnen/schließen)
|
||||||
|
menuToggle.addEventListener( 'click', function() {
|
||||||
|
siteNavigation.classList.toggle( 'toggled' );
|
||||||
|
|
||||||
|
// Aria States aktualisieren
|
||||||
|
if ( menuToggle.getAttribute( 'aria-expanded' ) === 'true' ) {
|
||||||
|
menuToggle.setAttribute( 'aria-expanded', 'false' );
|
||||||
|
menuToggle.innerHTML = '<i class="fas fa-bars"></i>';
|
||||||
|
} else {
|
||||||
|
menuToggle.setAttribute( 'aria-expanded', 'true' );
|
||||||
|
menuToggle.innerHTML = '<i class="fas fa-times"></i>';
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
// Mobile Submenu Toggle (Klick auf Parent-Item öffnet Untermenü)
|
||||||
|
const subMenuParents = siteNavigation.querySelectorAll( '.menu-item-has-children' );
|
||||||
|
|
||||||
|
subMenuParents.forEach( function( subMenuParent ) {
|
||||||
|
subMenuParent.addEventListener( 'click', function( e ) {
|
||||||
|
// Nur auf Mobil aktivieren (Media Query Check)
|
||||||
|
if ( window.innerWidth <= 992 ) {
|
||||||
|
// Optional: Verhindern, dass der Link geklickt wird, wenn man nur das Menü öffnen will
|
||||||
|
// e.preventDefault();
|
||||||
|
|
||||||
|
// Klasse 'active' umschalten für das CSS Display
|
||||||
|
this.classList.toggle( 'active' );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
} )();
|
||||||
@@ -1,65 +1,52 @@
|
|||||||
<!DOCTYPE html>
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
<html <?php language_attributes(); ?>>
|
// Hole den Slider-Container
|
||||||
<head>
|
const heroSlider = document.querySelector('.hero-slider');
|
||||||
<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() ) :
|
// Stelle sicher, dass der Slider auf der Seite existiert
|
||||||
?>
|
if (!heroSlider) {
|
||||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
return;
|
||||||
<?php else : ?>
|
|
||||||
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<nav id="site-navigation" class="main-navigation">
|
|
||||||
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false ) ); ?>
|
|
||||||
</nav>
|
|
||||||
<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>
|
// Konfiguration für den Slider vorbereiten
|
||||||
</div>
|
const swiperConfig = {
|
||||||
</div>
|
// Der Effekt ist jetzt fest auf "Überblenden" eingestellt
|
||||||
</div>
|
effect: 'fade',
|
||||||
</header>
|
fadeEffect: {
|
||||||
|
crossFade: true
|
||||||
|
},
|
||||||
|
|
||||||
|
// Loop-Einstellung ist jetzt DYNAMISCH
|
||||||
|
loop: sliderSettings.loop === '1',
|
||||||
|
|
||||||
|
// Autoplay
|
||||||
|
autoplay: {
|
||||||
|
delay: 5000,
|
||||||
|
disableOnInteraction: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
pauseOnMouseEnter: true,
|
||||||
|
|
||||||
|
// Prüfe, ob die Pfeile NICHT ausgeblendet werden sollen
|
||||||
|
navigation: sliderSettings.hideArrows !== '1' ? {
|
||||||
|
nextEl: '.swiper-button-next',
|
||||||
|
prevEl: '.swiper-button-prev',
|
||||||
|
} : false,
|
||||||
|
|
||||||
|
// Prüfe, ob die Paginierung NICHT ausgeblendet werden soll
|
||||||
|
pagination: sliderSettings.hidePagination !== '1' ? {
|
||||||
|
el: '.swiper-pagination',
|
||||||
|
clickable: true,
|
||||||
|
} : false,
|
||||||
|
|
||||||
|
on: {
|
||||||
|
init: function () {
|
||||||
|
setTimeout(() => {
|
||||||
|
heroSlider.classList.add('swiper-initialized');
|
||||||
|
}, 50);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Initialisiere den Slider mit der konfigurierten Optionen
|
||||||
|
new Swiper('.hero-slider', swiperConfig);
|
||||||
|
});
|
||||||
@@ -1,84 +1,84 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
Template Name: Benutzerdefinierte Authentifizierungsseite
|
Template Name: Benutzerdefinierte Authentifizierungsseite
|
||||||
*/
|
*/
|
||||||
|
|
||||||
get_header(); ?>
|
get_header(); ?>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div id="primary" class="content-area">
|
<div id="primary" class="content-area">
|
||||||
<main id="main" class="site-main">
|
<main id="main" class="site-main">
|
||||||
<div class="custom-auth-container">
|
<div class="custom-auth-container">
|
||||||
<?php if (is_user_logged_in()) : ?>
|
<?php if (is_user_logged_in()) : ?>
|
||||||
<!-- Wenn der Benutzer angemeldet ist, zeige eine Nachricht und einen Logout-Link -->
|
<!-- Wenn der Benutzer angemeldet ist, zeige eine Nachricht und einen Logout-Link -->
|
||||||
<div class="logged-in-message">
|
<div class="logged-in-message">
|
||||||
<h2>Willkommen zurück, <?php echo esc_html(wp_get_current_user()->display_name); ?>!</h2>
|
<h2>Willkommen zurück, <?php echo esc_html(wp_get_current_user()->display_name); ?>!</h2>
|
||||||
<p>Du bist bereits angemeldet.</p>
|
<p>Du bist bereits angemeldet.</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="<?php echo esc_url(wp_logout_url(home_url())); ?>" class="button">Abmelden</a>
|
<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>
|
<a href="<?php echo esc_url(admin_url()); ?>" class="button">Zum Dashboard</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<!-- Wenn der Benutzer nicht angemeldet ist, zeige das Registrierungsformular -->
|
<!-- Wenn der Benutzer nicht angemeldet ist, zeige das Registrierungsformular -->
|
||||||
<h1 class="auth-title">Willkommen auf <?php bloginfo('name'); ?></h1>
|
<h1 class="auth-title">Willkommen auf <?php bloginfo('name'); ?></h1>
|
||||||
<p class="auth-subtitle">Erstelle deinen Account und werde Teil unserer Community!</p>
|
<p class="auth-subtitle">Erstelle deinen Account und werde Teil unserer Community!</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Zeige das Registrierungsformular an
|
// Zeige das Registrierungsformular an
|
||||||
$args = array(
|
$args = array(
|
||||||
'echo' => true,
|
'echo' => true,
|
||||||
'redirect' => home_url('/login/?checkemail=registered'), // Weiterleitung nach der Registrierung
|
'redirect' => home_url('/login/?checkemail=registered'), // Weiterleitung nach der Registrierung
|
||||||
'form_id' => 'custom_registerform',
|
'form_id' => 'custom_registerform',
|
||||||
'label_username' => __( 'Benutzername' ),
|
'label_username' => __( 'Benutzername' ),
|
||||||
'label_email' => __( 'E-Mail-Adresse' ),
|
'label_email' => __( 'E-Mail-Adresse' ),
|
||||||
'label_password' => __( 'Passwort' ),
|
'label_password' => __( 'Passwort' ),
|
||||||
'label_remember' => __( 'Angemeldet bleiben' ),
|
'label_remember' => __( 'Angemeldet bleiben' ),
|
||||||
'label_log_in' => __( 'Registrieren' ),
|
'label_log_in' => __( 'Registrieren' ),
|
||||||
'id_username' => 'user_login',
|
'id_username' => 'user_login',
|
||||||
'id_email' => 'user_email',
|
'id_email' => 'user_email',
|
||||||
'id_password' => 'user_pass',
|
'id_password' => 'user_pass',
|
||||||
'id_remember' => 'rememberme',
|
'id_remember' => 'rememberme',
|
||||||
'id_submit' => 'wp-submit',
|
'id_submit' => 'wp-submit',
|
||||||
'remember' => true,
|
'remember' => true,
|
||||||
'value_username' => NULL,
|
'value_username' => NULL,
|
||||||
'value_remember' => false
|
'value_remember' => false
|
||||||
);
|
);
|
||||||
wp_register_form($args);
|
wp_register_form($args);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="login-form-link">
|
<div class="login-form-link">
|
||||||
<p>Schon hast du einen Account? <a href="<?php echo esc_url(wp_login_url()); ?>">Hier anmelden</a>.</p>
|
<p>Schon hast du einen Account? <a href="<?php echo esc_url(wp_login_url()); ?>">Hier anmelden</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Hintergrundbild aus dem Customizer holen und als Inline-CSS ausgeben
|
// Hintergrundbild aus dem Customizer holen und als Inline-CSS ausgeben
|
||||||
$auth_bg_image = get_theme_mod('login_background_image');
|
$auth_bg_image = get_theme_mod('login_background_image');
|
||||||
if ($auth_bg_image):
|
if ($auth_bg_image):
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
body.login, body.login-action-register {
|
body.login, body.login-action-register {
|
||||||
background-image: url('<?php echo esc_url($auth_bg_image); ?>') !important;
|
background-image: url('<?php echo esc_url($auth_bg_image); ?>') !important;
|
||||||
background-size: cover !important;
|
background-size: cover !important;
|
||||||
background-position: center !important;
|
background-position: center !important;
|
||||||
background-repeat: no-repeat !important;
|
background-repeat: no-repeat !important;
|
||||||
}
|
}
|
||||||
body.login::before, body.login-action-register::before {
|
body.login::before, body.login-action-register::before {
|
||||||
content: '';
|
content: '';
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: rgba(20, 21, 26, 0.8);
|
background: rgba(20, 21, 26, 0.8);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
<?php get_footer(); ?>
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user