Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 903333cac3 | |||
| 446e08dc91 | |||
| 231cf8fc6c | |||
| 2f93e98220 | |||
| 43f19e926a | |||
| 41e46b8804 | |||
| aa07d5bda3 | |||
| 76218121a4 | |||
| 04424d7f59 | |||
| 98640766c6 | |||
| 3e911e5ab7 | |||
| 036fa2be08 | |||
| efdda0d8ed | |||
| 1b961d75bd | |||
| 8144180b8b | |||
| 5a6a035fe1 | |||
| 7cd7abdead | |||
| e87c3f6f97 | |||
| f25fbf3869 | |||
| 32bbb0b36f | |||
| 75af878db9 | |||
| 88dd9e8c45 | |||
| 5be3e02b7d | |||
| 91df9b2f6f | |||
| f9753124e1 | |||
| 4bfd56887c | |||
| 12c762794b |
BIN
Minecraft-Modern-Theme-Child/screenshot.PNG
Normal file
BIN
Minecraft-Modern-Theme-Child/screenshot.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
276
Minecraft-Modern-Theme/css/login-style.css
Normal file
276
Minecraft-Modern-Theme/css/login-style.css
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
/* Minecraft Modern Theme Login & Registrierungs-Styles */
|
||||||
|
body.login, body.login-action-register {
|
||||||
|
background-color: #14151a; /* Fallback-Farbe */
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
font-family: 'Raleway', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dunkler Overlay für bessere Lesbarkeit */
|
||||||
|
body.login::before, body.login-action-register::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(20, 21, 26, 0.8);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Logo zentrieren */
|
||||||
|
body.login h1, body.login-action-register h1 {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
}
|
||||||
|
body.login h1 a, body.login-action-register h1 a {
|
||||||
|
width: auto;
|
||||||
|
height: 160px;
|
||||||
|
background-size: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Haupt-Container, der alles umschließt */
|
||||||
|
body.login #login, body.login-action-register #login {
|
||||||
|
width: 80%;
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
background: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Der Wrapper, der vom Skript erstellt wird. */
|
||||||
|
body.login #login-content-wrapper, body.login-action-register #login-content-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
background-color: #252830;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Linke Spalte: Minecraft Avatar Slider (27.8%) */
|
||||||
|
body.login #minecraft-avatar-slider, body.login-action-register #minecraft-avatar-slider {
|
||||||
|
flex: 0 0 27.8%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px;
|
||||||
|
padding-top: 50px;
|
||||||
|
background-color: #1a1c23;
|
||||||
|
height: auto;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login #minecraft-avatar-slider .avatar-slide, body.login-action-register #minecraft-avatar-slider .avatar-slide {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
max-height: 400px;
|
||||||
|
border-radius: 4px;
|
||||||
|
position: absolute;
|
||||||
|
top: 25px;
|
||||||
|
left: 0;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.7s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login #minecraft-avatar-slider .avatar-slide-active, body.login-action-register #minecraft-avatar-slider .avatar-slide-active {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Rechte Spalte: Login/Registrierungs-Formular (72.2%) */
|
||||||
|
body.login #loginform, body.login-action-register #registerform, body.login #loginform, body.login-action-register #registerform {
|
||||||
|
flex: 1;
|
||||||
|
padding: 40px;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Formular-Felder */
|
||||||
|
body.login #loginform p, body.login-action-register #registerform p,
|
||||||
|
body.login #loginform label, body.login-action-register #registerform label {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #e4e4e4;
|
||||||
|
font-weight: 600;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login #loginform input[type="text"], body.login #loginform input[type="password"], body.login-action-register #registerform input[type="text"], body.login-action-register #registerform input[type="password"], body.login #loginform input[type="email"], body.login-action-register #registerform input[type="email"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px;
|
||||||
|
background-color: #1e2029;
|
||||||
|
border: 1px solid #333;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #e4e4e4;
|
||||||
|
font-family: 'Raleway', sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: border-color 0.3s, box-shadow 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login #loginform input[type="text"]:focus, body.login #loginform input[type="password"]:focus, body.login-action-register #registerform input[type="text"]:focus, body.login-action-register #registerform input[type="password"]:focus, body.login-action-register #registerform input[type="email"]:focus {
|
||||||
|
border-color: #00d4ff;
|
||||||
|
box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* "Angemeldet bleiben" Checkbox (nur Login) */
|
||||||
|
body.login .forgetmenot label, body.login .forgetmenot input[type="checkbox"] {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #a0a0a0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
body.login .forgetmenot input[type="checkbox"] {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NEU: Stile für die Registrierungsseite */
|
||||||
|
.auth-title {
|
||||||
|
text-align: center;
|
||||||
|
color: #e4e4e4;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.auth-subtitle {
|
||||||
|
text-align: center;
|
||||||
|
color: #a0a0a0;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
.login-form-link {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
.login-form-link p {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.login-form-link a {
|
||||||
|
color: #00d4ff;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.login-form-link a:hover {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.logged-in-message {
|
||||||
|
text-align: center;
|
||||||
|
padding: 40px;
|
||||||
|
background-color: #252830;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
.logged-in-message h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
color: #00d4ff;
|
||||||
|
}
|
||||||
|
.logged-in-message .button {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 12px 25px;
|
||||||
|
background-color: #00d4ff;
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-weight: 600;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
.logged-in-message .button:hover {
|
||||||
|
background-color: #00a8cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Container für "Angemeldet bleiben" und "Passwort vergessen" (nur Login) */
|
||||||
|
body.login .login-options-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login .login-options-container .forgetmenot,
|
||||||
|
body.login .login-options-container #nav {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login .login-options-container #nav a {
|
||||||
|
color: #a0a0a0;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
body.login .login-options-container #nav a:hover {
|
||||||
|
color: #00d4ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Submit-Button (gilt für Login & Registrierung) */
|
||||||
|
body.login #loginform .submit input[type="submit"], body.login-action-register #registerform .submit input[type="submit"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px;
|
||||||
|
background-color: #00d4ff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: #fff;
|
||||||
|
font-family: 'Raleway', sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
body.login #loginform .submit input[type="submit"]:hover, body.login-action-register #registerform .submit input[type="submit"]:hover {
|
||||||
|
background-color: #00a8cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Anpassungen für kleinere Bildschirme */
|
||||||
|
@media screen and (max-width: 768px) {
|
||||||
|
body.login #login-content-wrapper, body.login-action-register #login-content-wrapper {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
body.login #minecraft-avatar-slider, body.login-action-register #minecraft-avatar-slider {
|
||||||
|
flex: none;
|
||||||
|
width: 100%;
|
||||||
|
padding: 30px;
|
||||||
|
padding-top: 30px;
|
||||||
|
}
|
||||||
|
body.login #minecraft-avatar-slider .avatar-slide, body.login-action-register #minecraft-avatar-slider .avatar-slide {
|
||||||
|
max-height: 300px;
|
||||||
|
max-width: 200px;
|
||||||
|
top: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fehlermeldungen und Hinweise */
|
||||||
|
body.login .message, body.login #login_error, body.login-action-register .message, body.login-action-register #login_error {
|
||||||
|
background-color: rgba(0, 212, 255, 0.1);
|
||||||
|
border-left: 4px solid #00d4ff;
|
||||||
|
padding: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-radius: 0 4px 4px 0;
|
||||||
|
color: #e4e4e4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================================
|
||||||
|
=== STIL FÜR DIE LINKS UNTER DEM ANMELDE-BUTTON ====================
|
||||||
|
========================================================================= */
|
||||||
|
|
||||||
|
body.login .post-login-links, body.login-action-register .post-login-links {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 15px;
|
||||||
|
padding-top: 15px;
|
||||||
|
border-top: 1px solid #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login .post-login-links a, body.login-action-register .post-login-links a {
|
||||||
|
color: #a0a0a0;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.login .post-login-links a:hover, body.login-action-register .post-login-links a:hover {
|
||||||
|
color: #00d4ff;
|
||||||
|
}
|
||||||
@@ -1,80 +1,92 @@
|
|||||||
<?php get_header(); ?>
|
<?php get_header(); ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
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>
|
||||||
<div class="swiper-pagination"></div>
|
|
||||||
<div class="swiper-button-prev"></div>
|
<!-- Nur anzeigen, wenn die Paginierung NICHT ausgeblendet ist -->
|
||||||
<div class="swiper-button-next"></div>
|
<?php if ( ! get_theme_mod('slider_hide_pagination', false) ) : ?>
|
||||||
</section>
|
<div class="swiper-pagination"></div>
|
||||||
<?php else : ?>
|
<?php endif; ?>
|
||||||
<?php
|
|
||||||
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
<!-- Nur anzeigen, wenn die Pfeile NICHT ausgeblendet sind -->
|
||||||
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
<?php if ( ! get_theme_mod('slider_hide_arrows', false) ) : ?>
|
||||||
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
<div class="swiper-button-prev"></div>
|
||||||
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
<div class="swiper-button-next"></div>
|
||||||
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
<?php endif; ?>
|
||||||
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
|
||||||
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
</section>
|
||||||
?>
|
<?php else : ?>
|
||||||
<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) . "')" : ''; ?>">
|
<?php
|
||||||
<div class="container">
|
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
||||||
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
|
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
||||||
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
|
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
||||||
<div class="hero-buttons">
|
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
||||||
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
|
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
||||||
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
|
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
||||||
</div>
|
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
||||||
</div>
|
?>
|
||||||
</section>
|
<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) . "')" : ''; ?>">
|
||||||
<?php endif; ?>
|
<div class="container">
|
||||||
|
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
|
||||||
<main id="primary" class="site-main">
|
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
|
||||||
<div class="container">
|
<div class="hero-buttons">
|
||||||
<div class="content-area">
|
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
|
||||||
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
|
||||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
|
</div>
|
||||||
<?php if ( has_post_thumbnail() ) : ?>
|
</div>
|
||||||
<div class="post-thumbnail">
|
</section>
|
||||||
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<main id="primary" class="site-main">
|
||||||
<div class="post-content">
|
<div class="container">
|
||||||
<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
<div class="content-area">
|
||||||
<div class="post-excerpt">
|
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
||||||
<?php the_excerpt(); ?>
|
<article id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
|
||||||
</div>
|
<?php if ( has_post_thumbnail() ) : ?>
|
||||||
</div>
|
<div class="post-thumbnail">
|
||||||
</article>
|
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
||||||
<?php endwhile; else : ?>
|
</div>
|
||||||
<p><?php _e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<div class="post-content">
|
||||||
</div>
|
<h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
|
||||||
</div>
|
<!-- =================================================================== -->
|
||||||
</main>
|
<!-- === HIER IST DIE ÄNDERUNG: Vollen Inhalt anstelle des Auszugs === -->
|
||||||
|
<!-- =================================================================== -->
|
||||||
|
<div class="post-full-content">
|
||||||
|
<?php the_content(); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<?php endwhile; else : ?>
|
||||||
|
<p><?php _e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
<?php get_footer(); ?>
|
||||||
@@ -1,240 +1,417 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Exit if accessed directly.
|
// Exit if accessed directly.
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// === Theme Setup ===
|
// === Theme Setup ===
|
||||||
function minecraft_modern_setup() {
|
function minecraft_modern_setup() {
|
||||||
add_theme_support( 'title-tag' );
|
add_theme_support( 'title-tag' );
|
||||||
add_theme_support( 'post-thumbnails' );
|
add_theme_support( 'post-thumbnails' );
|
||||||
|
|
||||||
// Logo-Unterstützung aktivieren (Maximale Flexibilität)
|
// Logo-Unterstützung aktivieren (Maximale Flexibilität)
|
||||||
add_theme_support( 'custom-logo', array(
|
add_theme_support( 'custom-logo', array(
|
||||||
'height' => 9999, // Sehr hohe Werte, um den Crop-Dialog zu umgehen
|
'height' => 9999, // Sehr hohe Werte, um den Crop-Dialog zu umgehen
|
||||||
'width' => 9999, // Sehr hohe Werte, um den Crop-Dialog zu umgehen
|
'width' => 9999, // Sehr hohe Werte, um den Crop-Dialog zu umgehen
|
||||||
'flex-height' => true,
|
'flex-height' => true,
|
||||||
'flex-width' => true,
|
'flex-width' => true,
|
||||||
'header-text' => array( 'site-title', 'site-description' ),
|
'header-text' => array( 'site-title', 'site-description' ),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Benutzerdefinierten Hintergrund aktivieren
|
// Benutzerdefinierten Hintergrund aktivieren
|
||||||
add_theme_support( 'custom-background' );
|
add_theme_support( 'custom-background' );
|
||||||
|
|
||||||
register_nav_menus( array(
|
register_nav_menus( array(
|
||||||
'primary' => __( 'Hauptmenü', 'minecraft-modern-theme' ),
|
'primary' => __( 'Hauptmenü', 'minecraft-modern-theme' ),
|
||||||
'footer' => __( 'Footer-Menü', 'minecraft-modern-theme' ),
|
'footer' => __( 'Footer-Menü', 'minecraft-modern-theme' ),
|
||||||
) );
|
) );
|
||||||
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
|
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
|
||||||
}
|
}
|
||||||
add_action( 'after_setup_theme', 'minecraft_modern_setup' );
|
add_action( 'after_setup_theme', 'minecraft_modern_setup' );
|
||||||
|
|
||||||
// === Styles & Scripts laden ===
|
// === Styles & Scripts laden ===
|
||||||
function minecraft_modern_scripts() {
|
function minecraft_modern_scripts() {
|
||||||
// Haupt-Stylesheet
|
// Haupt-Stylesheet
|
||||||
wp_enqueue_style( 'minecraft-modern-style', get_stylesheet_uri() );
|
wp_enqueue_style( 'minecraft-modern-style', get_stylesheet_uri() );
|
||||||
|
|
||||||
// Swiper.js CSS (von CDN)
|
// Swiper.js CSS (von CDN)
|
||||||
wp_enqueue_style( 'swiper-css', 'https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css' );
|
wp_enqueue_style( 'swiper-css', 'https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css' );
|
||||||
|
|
||||||
// JavaScript für den Header-Scroll-Effekt
|
// JavaScript für den Header-Scroll-Effekt
|
||||||
wp_enqueue_script(
|
wp_enqueue_script(
|
||||||
'minecraft-modern-header-script',
|
'minecraft-modern-header-script',
|
||||||
get_template_directory_uri() . '/js/header-scroll.js',
|
get_template_directory_uri() . '/js/header-scroll.js',
|
||||||
array(),
|
array(),
|
||||||
'1.0',
|
'1.0',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Swiper.js JS (von CDN)
|
// NEU: Ankündigungs-Skript laden
|
||||||
wp_enqueue_script(
|
wp_enqueue_script(
|
||||||
'swiper-js',
|
'announcement-script',
|
||||||
'https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js',
|
get_template_directory_uri() . '/js/announcement.js',
|
||||||
array(),
|
array(), // Keine Abhängigkeiten
|
||||||
'8.0.0',
|
'1.0',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Unsere eigene Slider-Initialisierungs-Datei
|
// Swiper.js JS (von CDN)
|
||||||
wp_enqueue_script(
|
wp_enqueue_script(
|
||||||
'minecraft-modern-slider-script',
|
'swiper-js',
|
||||||
get_template_directory_uri() . '/js/slider-init.js',
|
'https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js',
|
||||||
array('swiper-js'), // Hängt von Swiper.js ab
|
array(),
|
||||||
'1.0',
|
'8.0.0',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// NEU: Theme-Toggle-Skript laden
|
// Unsere eigene Slider-Initialisierungs-Datei
|
||||||
wp_enqueue_script(
|
wp_enqueue_script(
|
||||||
'theme-toggle-script',
|
'minecraft-modern-slider-script',
|
||||||
get_template_directory_uri() . '/js/theme-toggle.js',
|
get_template_directory_uri() . '/js/slider-init.js',
|
||||||
array(), // Keine Abhängigkeiten
|
array('swiper-js'), // Hängt von Swiper.js ab
|
||||||
'1.0',
|
'1.0',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
// FAQ Skript laden, wenn der Post-Type aktiv ist
|
// NEU: Theme-Toggle-Skript laden
|
||||||
if ( post_type_exists('faq') ) {
|
wp_enqueue_script(
|
||||||
wp_enqueue_script(
|
'theme-toggle-script',
|
||||||
'faq-accordion-script',
|
get_template_directory_uri() . '/js/theme-toggle.js',
|
||||||
get_template_directory_uri() . '/js/faq-accordion.js',
|
array(), // Keine Abhängigkeiten
|
||||||
array(),
|
'1.0',
|
||||||
'1.0',
|
true
|
||||||
true
|
);
|
||||||
);
|
|
||||||
}
|
// FAQ Skript laden, wenn der Post-Type aktiv ist
|
||||||
|
if ( post_type_exists('faq') ) {
|
||||||
// Übergebe ALLE Theme-Einstellungen an das JavaScript
|
wp_enqueue_script(
|
||||||
// KORREKTUR: Der Objektname muss 'sliderSettings' bleiben, damit slider-init.js funktioniert.
|
'faq-accordion-script',
|
||||||
wp_localize_script(
|
get_template_directory_uri() . '/js/faq-accordion.js',
|
||||||
'minecraft-modern-slider-script',
|
array(),
|
||||||
'sliderSettings',
|
'1.0',
|
||||||
array(
|
true
|
||||||
'hideArrows' => get_theme_mod( 'slider_hide_arrows', false ) ? '1' : '0',
|
);
|
||||||
'hidePagination' => get_theme_mod( 'slider_hide_pagination', false ) ? '1' : '0',
|
}
|
||||||
'defaultMode' => get_theme_mod( 'default_theme_mode', 'dark' ),
|
|
||||||
'ajax_url' => admin_url('admin-ajax.php')
|
// Übergebe ALLE Theme-Einstellungen an das JavaScript
|
||||||
)
|
wp_localize_script(
|
||||||
);
|
'minecraft-modern-slider-script',
|
||||||
|
'sliderSettings',
|
||||||
// === NEU & WICHTIG: Header-Skript-Informationen übergeben ===
|
array(
|
||||||
// Dies verhindert das Flackern im Customizer.
|
'hideArrows' => get_theme_mod( 'slider_hide_arrows', false ) ? '1' : '0',
|
||||||
wp_localize_script(
|
'hidePagination' => get_theme_mod( 'slider_hide_pagination', false ) ? '1' : '0',
|
||||||
'minecraft-modern-header-script', // <-- Richtiges Skript-Handle!
|
'effect' => get_theme_mod( 'slider_effect', 'fade' ),
|
||||||
'headerSettings', // <-- Neuer Objektname für Klarheit
|
'direction' => get_theme_mod( 'slider_direction', 'horizontal' ),
|
||||||
array(
|
'defaultMode' => get_theme_mod( 'default_theme_mode', 'dark' ),
|
||||||
'isCustomizer' => is_customize_preview()
|
'ajax_url' => admin_url('admin-ajax.php')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
|
||||||
add_action( 'wp_enqueue_scripts', 'minecraft_modern_scripts' );
|
// === NEU & WICHTIG: Header-Skript-Informationen übergeben ===
|
||||||
|
// Dies verhindert das Flackern im Customizer.
|
||||||
// === Customizer-Datei laden ===
|
wp_localize_script(
|
||||||
require get_template_directory() . '/inc/customizer.php';
|
'minecraft-modern-header-script', // <-- Richtiges Skript-Handle!
|
||||||
|
'headerSettings', // <-- Neuer Objektname für Klarheit
|
||||||
// === Footer-Widgets registrieren ===
|
array(
|
||||||
function minecraft_modern_footer_widgets() {
|
'isCustomizer' => is_customize_preview()
|
||||||
register_sidebar( array(
|
)
|
||||||
'name' => __( 'Footer Links', 'minecraft-modern-theme' ),
|
);
|
||||||
'id' => 'footer-left',
|
}
|
||||||
'description' => __( 'Widget-Bereich links im Footer.', 'minecraft-modern-theme' ),
|
add_action( 'wp_enqueue_scripts', 'minecraft_modern_scripts' );
|
||||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
|
||||||
'after_widget' => '</div>',
|
// === Customizer-Datei laden ===
|
||||||
'before_title' => '<h4 class="widget-title">',
|
require get_template_directory() . '/inc/customizer.php';
|
||||||
'after_title' => '</h4>',
|
|
||||||
) );
|
// === Footer-Widgets registrieren ===
|
||||||
for ( $i = 1; $i <= 3; $i++ ) {
|
function minecraft_modern_footer_widgets() {
|
||||||
register_sidebar( array(
|
register_sidebar( array(
|
||||||
'name' => sprintf( __( 'Footer Spalte %d', 'minecraft-modern-theme' ), $i ),
|
'name' => __( 'Footer Links', 'minecraft-modern-theme' ),
|
||||||
'id' => 'footer-' . $i,
|
'id' => 'footer-left',
|
||||||
'description' => sprintf( __( 'Widget für die %d. Spalte im Footer.', 'minecraft-modern-theme' ), $i ),
|
'description' => __( 'Widget-Bereich links im Footer.', 'minecraft-modern-theme' ),
|
||||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||||
'after_widget' => '</div>',
|
'after_widget' => '</div>',
|
||||||
'before_title' => '<h4 class="widget-title">',
|
'before_title' => '<h4 class="widget-title">',
|
||||||
'after_title' => '</h4>',
|
'after_title' => '</h4>',
|
||||||
) );
|
) );
|
||||||
}
|
for ( $i = 1; $i <= 3; $i++ ) {
|
||||||
register_sidebar( array(
|
register_sidebar( array(
|
||||||
'name' => __( 'Footer Rechts', 'minecraft-modern-theme' ),
|
'name' => sprintf( __( 'Footer Spalte %d', 'minecraft-modern-theme' ), $i ),
|
||||||
'id' => 'footer-right',
|
'id' => 'footer-' . $i,
|
||||||
'description' => __( 'Widget-Bereich rechts im Footer.', 'minecraft-modern-theme' ),
|
'description' => sprintf( __( 'Widget für die %d. Spalte im Footer.', 'minecraft-modern-theme' ), $i ),
|
||||||
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||||
'after_widget' => '</div>',
|
'after_widget' => '</div>',
|
||||||
'before_title' => '<h4 class="widget-title">',
|
'before_title' => '<h4 class="widget-title">',
|
||||||
'after_title' => '</h4>',
|
'after_title' => '</h4>',
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
add_action( 'widgets_init', 'minecraft_modern_footer_widgets' );
|
register_sidebar( array(
|
||||||
|
'name' => __( 'Footer Rechts', 'minecraft-modern-theme' ),
|
||||||
// === FAQ Custom Post Type & Taxonomy ===
|
'id' => 'footer-right',
|
||||||
function create_faq_post_type() {
|
'description' => __( 'Widget-Bereich rechts im Footer.', 'minecraft-modern-theme' ),
|
||||||
// Nur registrieren, wenn im Customizer aktiviert
|
'before_widget' => '<div id="%1$s" class="widget %2$s">',
|
||||||
if ( get_theme_mod( 'faq_enabled', true ) ) {
|
'after_widget' => '</div>',
|
||||||
register_post_type('faq',
|
'before_title' => '<h4 class="widget-title">',
|
||||||
array(
|
'after_title' => '</h4>',
|
||||||
'labels' => array(
|
) );
|
||||||
'name' => __( 'FAQs', 'minecraft-modern-theme' ),
|
}
|
||||||
'singular_name' => __( 'FAQ', 'minecraft-modern-theme' ),
|
add_action( 'widgets_init', 'minecraft_modern_footer_widgets' );
|
||||||
'add_new' => __( 'Neue FAQ hinzufügen', 'minecraft-modern-theme' ),
|
|
||||||
'add_new_item' => __( 'Neue FAQ hinzufügen', 'minecraft-modern-theme' ),
|
// === FAQ Custom Post Type & Taxonomy ===
|
||||||
'edit_item' => __( 'FAQ bearbeiten', 'minecraft-modern-theme' ),
|
function create_faq_post_type() {
|
||||||
'new_item' => __( 'Neue FAQ', 'minecraft-modern-theme' ),
|
// Nur registrieren, wenn im Customizer aktiviert
|
||||||
'view_item' => __( 'FAQ ansehen', 'minecraft-modern-theme' ),
|
if ( get_theme_mod( 'faq_enabled', true ) ) {
|
||||||
'search_items' => __( 'FAQs durchsuchen', 'minecraft-modern-theme' ),
|
register_post_type('faq',
|
||||||
'not_found' => __( 'Keine FAQs gefunden', 'minecraft-modern-theme' ),
|
array(
|
||||||
'not_found_in_trash' => __( 'Keine FAQs im Papierkorb gefunden', 'minecraft-modern-theme' ),
|
'labels' => array(
|
||||||
'all_items' => __( 'Alle FAQs', 'minecraft-modern-theme' ),
|
'name' => __( 'FAQs', 'minecraft-modern-theme' ),
|
||||||
),
|
'singular_name' => __( 'FAQ', 'minecraft-modern-theme' ),
|
||||||
'public' => true,
|
'add_new' => __( 'Neue FAQ hinzufügen', 'minecraft-modern-theme' ),
|
||||||
'has_archive' => true, // Archiv-Seite /faq/ bleibt als Fallback
|
'add_new_item' => __( 'Neue FAQ hinzufügen', 'minecraft-modern-theme' ),
|
||||||
'menu_icon' => 'dashicons-format-chat',
|
'edit_item' => __( 'FAQ bearbeiten', 'minecraft-modern-theme' ),
|
||||||
'supports' => array( 'title', 'editor', 'page-attributes' ),
|
'new_item' => __( 'Neue FAQ', 'minecraft-modern-theme' ),
|
||||||
'rewrite' => array( 'slug' => 'faq' ),
|
'view_item' => __( 'FAQ ansehen', 'minecraft-modern-theme' ),
|
||||||
'show_in_rest' => true,
|
'search_items' => __( 'FAQs durchsuchen', 'minecraft-modern-theme' ),
|
||||||
)
|
'not_found' => __( 'Keine FAQs gefunden', 'minecraft-modern-theme' ),
|
||||||
);
|
'not_found_in_trash' => __( 'Keine FAQs im Papierkorb gefunden', 'minecraft-modern-theme' ),
|
||||||
register_taxonomy(
|
'all_items' => __( 'Alle FAQs', 'minecraft-modern-theme' ),
|
||||||
'faq_category',
|
),
|
||||||
'faq',
|
'public' => true,
|
||||||
array(
|
'has_archive' => true, // Archiv-Seite /faq/ bleibt als Fallback
|
||||||
'label' => __( 'FAQ Kategorien', 'minecraft-modern-theme' ),
|
'menu_icon' => 'dashicons-format-chat',
|
||||||
'rewrite' => array( 'slug' => 'faq-kategorie' ),
|
'supports' => array( 'title', 'editor', 'page-attributes' ),
|
||||||
'hierarchical' => true,
|
'rewrite' => array( 'slug' => 'faq' ),
|
||||||
'show_in_rest' => true,
|
'show_in_rest' => true,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
register_taxonomy(
|
||||||
}
|
'faq_category',
|
||||||
add_action('init', 'create_faq_post_type');
|
'faq',
|
||||||
|
array(
|
||||||
|
'label' => __( 'FAQ Kategorien', 'minecraft-modern-theme' ),
|
||||||
// =============================================================================
|
'rewrite' => array( 'slug' => 'faq-kategorie' ),
|
||||||
// NEU: Automatische FAQ-Seitenerstellung und Template-Zuweisung
|
'hierarchical' => true,
|
||||||
// =============================================================================
|
'show_in_rest' => true,
|
||||||
|
)
|
||||||
/**
|
);
|
||||||
* Erstellt automatisch eine "FAQ" Seite, wenn die FAQ-Funktion aktiviert wird.
|
}
|
||||||
*/
|
}
|
||||||
function create_faq_page_automatically() {
|
add_action('init', 'create_faq_post_type');
|
||||||
// Prüfen, ob die FAQ-Funktion aktiv ist
|
|
||||||
if ( get_theme_mod( 'faq_enabled', true ) ) {
|
// =============================================================================
|
||||||
// Prüfen, ob die Seite bereits existiert
|
// NEU: Automatische "Home" Seitenerstellung und Zuweisung (kombiniert)
|
||||||
if ( get_page_by_title( 'FAQ' ) == null ) {
|
// =============================================================================
|
||||||
// Seite erstellen
|
|
||||||
$new_page = array(
|
/**
|
||||||
'post_title' => 'FAQ',
|
* Erstellt die "Home" Seite und weist sie automatisch als statische Startseite zu,
|
||||||
'post_content' => 'Diese Seite zeigt alle FAQs an. Der Inhalt wird automatisch generiert.',
|
* wenn das Theme aktiviert wird und noch keine Seite festgelegt ist.
|
||||||
'post_status' => 'publish',
|
*/
|
||||||
'post_type' => 'page',
|
function set_static_front_page_automatically() {
|
||||||
'post_author' => 1,
|
// Nur ausführen, wenn noch keine statische Seite als Startseite festgelegt ist
|
||||||
);
|
if ( 'page' !== get_option( 'show_on_front' ) ) {
|
||||||
// Seite in die Datenbank einfügen
|
|
||||||
wp_insert_post( $new_page );
|
// Finde die "Home" Seite (oder erstelle sie, falls sie nicht existiert)
|
||||||
}
|
$home_page = get_page_by_title( 'Home' );
|
||||||
}
|
if ( ! $home_page ) {
|
||||||
}
|
// Seite erstellen, falls sie nicht existiert
|
||||||
// Diese Funktion wird ausgeführt, wenn der Customizer gespeichert wird.
|
$home_page_id = wp_insert_post( array(
|
||||||
add_action( 'customize_save_after', 'create_faq_page_automatically' );
|
'post_title' => 'Home',
|
||||||
|
'post_content' => 'Diese Seite dient als statische Startseite.',
|
||||||
|
'post_status' => 'publish',
|
||||||
/**
|
'post_type' => 'page',
|
||||||
* Leitet Anfragen für die "FAQ" Seite auf unser spezielles Template um.
|
'post_author' => 1,
|
||||||
*/
|
) );
|
||||||
function load_faq_page_template( $template ) {
|
} else {
|
||||||
// Prüfen, ob die FAQ-Funktion aktiv ist
|
$home_page_id = $home_page->ID;
|
||||||
if ( get_theme_mod( 'faq_enabled', true ) ) {
|
}
|
||||||
// Prüfen, ob wir uns auf einer Seite befinden
|
|
||||||
if ( is_page() ) {
|
// Setze die Seite als statische Startseite
|
||||||
global $post;
|
if ( $home_page_id ) {
|
||||||
// Prüfen, ob der Titel der Seite "FAQ" ist
|
update_option( 'show_on_front', 'page' );
|
||||||
if ( $post && $post->post_title == 'FAQ' ) {
|
update_option( 'page_on_front', $home_page_id );
|
||||||
// Pfad zu unserem Template zurückgeben
|
}
|
||||||
return get_template_directory() . '/archive-faq.php';
|
}
|
||||||
}
|
}
|
||||||
}
|
add_action( 'after_switch_theme', 'set_static_front_page_automatically' );
|
||||||
}
|
|
||||||
// Standard-Template in allen anderen Fällen
|
|
||||||
return $template;
|
/**
|
||||||
}
|
* Fügt eine Body-Klasse hinzu, um den Home-Titel per CSS auszublenden.
|
||||||
add_filter( 'template_include', 'load_faq_page_template' );
|
*/
|
||||||
|
function add_home_body_class( $classes ) {
|
||||||
|
// Prüfen, ob wir auf der Startseite sind und die Einstellung zum Ausblenden aktiv ist
|
||||||
|
if ( is_front_page() && !get_theme_mod( 'show_home_title', true ) ) {
|
||||||
|
$classes[] = 'home-title-hidden';
|
||||||
|
}
|
||||||
|
return $classes;
|
||||||
|
}
|
||||||
|
add_filter( 'body_class', 'add_home_body_class' );
|
||||||
|
|
||||||
|
|
||||||
|
// =============================================================================
|
||||||
|
// Automatische FAQ-Seitenerstellung und Template-Zuweisung
|
||||||
|
// =============================================================================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Erstellt automatisch eine "FAQ" Seite, wenn die FAQ-Funktion aktiviert wird.
|
||||||
|
*/
|
||||||
|
function create_faq_page_automatically() {
|
||||||
|
// Prüfen, ob die FAQ-Funktion aktiv ist
|
||||||
|
if ( get_theme_mod( 'faq_enabled', true ) ) {
|
||||||
|
// Prüfen, ob die Seite bereits existiert
|
||||||
|
if ( get_page_by_title( 'FAQ' ) == null ) {
|
||||||
|
// Seite erstellen
|
||||||
|
$new_page = array(
|
||||||
|
'post_title' => 'FAQ',
|
||||||
|
'post_content' => 'Diese Seite zeigt alle FAQs an. Der Inhalt wird automatisch generiert.',
|
||||||
|
'post_status' => 'publish',
|
||||||
|
'post_type' => 'page',
|
||||||
|
'post_author' => 1,
|
||||||
|
);
|
||||||
|
// Seite in die Datenbank einfügen
|
||||||
|
wp_insert_post( $new_page );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Diese Funktion wird ausgeführt, wenn der Customizer gespeichert wird.
|
||||||
|
add_action( 'customize_save_after', 'create_faq_page_automatically' );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Leitet Anfragen für die "FAQ" Seite auf unser spezielles Template um.
|
||||||
|
*/
|
||||||
|
function load_faq_page_template( $template ) {
|
||||||
|
// Prüfen, ob die FAQ-Funktion aktiv ist
|
||||||
|
if ( get_theme_mod( 'faq_enabled', true ) ) {
|
||||||
|
// Prüfen, ob wir uns auf einer Seite befinden
|
||||||
|
if ( is_page() ) {
|
||||||
|
global $post;
|
||||||
|
// Prüfen, ob der Titel der Seite "FAQ" ist
|
||||||
|
if ( $post && $post->post_title == 'FAQ' ) {
|
||||||
|
// Pfad zu unserem Template zurückgeben
|
||||||
|
return get_template_directory() . '/archive-faq.php';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Standard-Template in allen anderen Fällen
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
|
add_filter( 'template_include', 'load_faq_page_template' );
|
||||||
|
|
||||||
|
|
||||||
|
// =========================================================================
|
||||||
|
// === CUSTOM LOGIN FUNCTIONS (KOMPLETT NEU & KORRIGIERT) ==========
|
||||||
|
// =========================================================================
|
||||||
|
|
||||||
|
// Lädt alle notwendigen Styles und Scripts nur für die Login-Seite
|
||||||
|
function minecraft_modern_login_assets() {
|
||||||
|
// Lade die Login-spezifische CSS
|
||||||
|
wp_enqueue_style('minecraft-modern-login-style', get_template_directory_uri() . '/css/login-style.css');
|
||||||
|
|
||||||
|
// Lade Font Awesome für Icons
|
||||||
|
wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');
|
||||||
|
|
||||||
|
// Lade das JavaScript für den Avatar-Slider
|
||||||
|
wp_enqueue_script('minecraft-avatar-slider-script', get_template_directory_uri() . '/js/login-slider.js', array('jquery'), '1.0', true);
|
||||||
|
|
||||||
|
// Lade das JavaScript, das die HTML-Struktur anpasst
|
||||||
|
wp_enqueue_script('minecraft-modern-login-script', get_template_directory_uri() . '/js/login-script.js', array('jquery'), '1.0', true);
|
||||||
|
|
||||||
|
wp_add_inline_script('minecraft-modern-login-script', "
|
||||||
|
jQuery(document).ready(function($) {
|
||||||
|
$('.forgetmenot, #nav').wrapAll('<div class=\"login-options-container\"></div>');
|
||||||
|
});
|
||||||
|
");
|
||||||
|
|
||||||
|
// Übergebe die Slider-Geschwindigkeit aus dem Customizer an das JavaScript
|
||||||
|
$slider_speed = get_theme_mod('login_avatar_slider_speed', 4); // Standard: 4 Sekunden
|
||||||
|
wp_localize_script('minecraft-avatar-slider-script', 'avatarSliderSettings', array(
|
||||||
|
'speed' => $slider_speed * 1000 // Umwandlung in Millisekunden für JS
|
||||||
|
));
|
||||||
|
|
||||||
|
// Hintergrundbild und Logo als Inline-CSS hinzufügen
|
||||||
|
$login_bg_image = get_theme_mod('login_background_image');
|
||||||
|
if ($login_bg_image) {
|
||||||
|
$custom_css = "body.login { background-image: url('{$login_bg_image}') !important; }";
|
||||||
|
wp_add_inline_style('minecraft-modern-login-style', $custom_css);
|
||||||
|
}
|
||||||
|
$logo_url = get_theme_mod('login_logo');
|
||||||
|
if ($logo_url) {
|
||||||
|
$logo_css = ".login h1 a { background-image: url('{$logo_url}') !important; }";
|
||||||
|
wp_add_inline_style('minecraft-modern-login-style', $logo_css);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action('login_enqueue_scripts', 'minecraft_modern_login_assets');
|
||||||
|
|
||||||
|
// Erstellt die HTML-Struktur für den Avatar-Slider
|
||||||
|
function add_minecraft_avatar_slider_to_login() {
|
||||||
|
$avatar_html = '<div id="minecraft-avatar-slider">';
|
||||||
|
$has_avatars = false;
|
||||||
|
|
||||||
|
// Durchlaufe alle 5 möglichen Avatar-Plätze
|
||||||
|
for ($i = 1; $i <= 5; $i++) {
|
||||||
|
$uuid = get_theme_mod('login_avatar_uuid_' . $i);
|
||||||
|
if (!empty($uuid)) {
|
||||||
|
$has_avatars = true;
|
||||||
|
$avatar_url = "https://visage.surgeplay.com/full/{$uuid}.png";
|
||||||
|
// Das erste Bild wird direkt angezeigt
|
||||||
|
$active_class = ($i === 1) ? 'avatar-slide-active' : '';
|
||||||
|
$avatar_html .= '<img class="avatar-slide ' . esc_attr($active_class) . '" src="' . esc_url($avatar_url) . '" alt="Minecraft Avatar ' . ($i + 1) . '">';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$avatar_html .= '</div>';
|
||||||
|
|
||||||
|
// Nur den Slider ausgeben, wenn mindestens ein Avatar hinterlegt wurde
|
||||||
|
if ($has_avatars) {
|
||||||
|
echo $avatar_html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action('login_form', 'add_minecraft_avatar_slider_to_login');
|
||||||
|
|
||||||
|
function add_post_login_links() {
|
||||||
|
?>
|
||||||
|
<div class="post-login-links">
|
||||||
|
<a href="<?php echo esc_url(home_url()); ?>">← Zu <?php bloginfo('name'); ?></a>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
add_action('login_form_bottom', 'add_post_login_links');
|
||||||
|
|
||||||
|
// Entfernt unnötige Elemente von der Login-Seite
|
||||||
|
function customize_login_page() {
|
||||||
|
add_filter('login_display_language_dropdown', '__return_false');
|
||||||
|
add_filter('login_display_back_to_blog', '__return_false');
|
||||||
|
}
|
||||||
|
add_action('login_head', 'customize_login_page');
|
||||||
|
|
||||||
|
// Passt Login-URL und Titel an
|
||||||
|
function custom_login_url() { return home_url(); }
|
||||||
|
add_filter('login_headerurl', 'custom_login_url');
|
||||||
|
function custom_login_title() { return get_bloginfo('name'); }
|
||||||
|
add_filter('login_headertext', 'custom_login_title');
|
||||||
|
|
||||||
|
// =========================================================================
|
||||||
|
// === SCROLL TO TOP BUTTON ===============================================
|
||||||
|
// =========================================================================
|
||||||
|
|
||||||
|
// Fügt den HTML-Code für den Button zum Footer hinzu
|
||||||
|
function add_scroll_to_top_button() {
|
||||||
|
?>
|
||||||
|
<a href="#" id="scroll-to-top" title="Nach oben scrollen">
|
||||||
|
<i class="fas fa-chevron-up"></i>
|
||||||
|
</a>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
add_action('wp_footer', 'add_scroll_to_top_button');
|
||||||
|
|
||||||
|
// Lädt das JavaScript für den Scroll-to-Top Button
|
||||||
|
function minecraft_modern_scroll_to_top_script() {
|
||||||
|
wp_enqueue_script(
|
||||||
|
'minecraft-scroll-to-top-script',
|
||||||
|
get_template_directory_uri() . '/js/scroll-to-top.js',
|
||||||
|
array('jquery'),
|
||||||
|
'1.0',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
add_action('wp_enqueue_scripts', 'minecraft_modern_scroll_to_top_script');
|
||||||
@@ -1,67 +1,65 @@
|
|||||||
<!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">
|
<header id="masthead" class="site-header">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="header-main">
|
<div class="header-main">
|
||||||
<div class="site-branding">
|
<div class="site-branding">
|
||||||
<?php
|
<?php
|
||||||
// Zeigt das Logo an, wenn eines vorhanden ist.
|
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
|
||||||
if ( function_exists( 'the_custom_logo' ) && has_custom_logo() ) {
|
the_custom_logo();
|
||||||
the_custom_logo();
|
}
|
||||||
}
|
?>
|
||||||
?>
|
<?php
|
||||||
<?php
|
|
||||||
// Zeigt den Titel der Website IMMER an.
|
if ( is_front_page() && is_home() ) :
|
||||||
// Verwendet <h1> auf der Startseite, sonst <p> für bessere SEO.
|
?>
|
||||||
if ( is_front_page() && is_home() ) :
|
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||||
?>
|
<?php else : ?>
|
||||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
||||||
<?php else : ?>
|
<?php endif; ?>
|
||||||
<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
|
</div>
|
||||||
<?php endif; ?>
|
<nav id="site-navigation" class="main-navigation">
|
||||||
</div>
|
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false ) ); ?>
|
||||||
<nav id="site-navigation" class="main-navigation">
|
</nav>
|
||||||
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false ) ); ?>
|
<div class="header-info">
|
||||||
</nav>
|
<div class="social-links">
|
||||||
<div class="header-info">
|
<?php
|
||||||
<div class="social-links">
|
// Array mit den Social-Media-Plattformen und ihren Font Awesome Klassen
|
||||||
<?php
|
$social_icons = array(
|
||||||
// Array mit den Social-Media-Plattformen und ihren Font Awesome Klassen
|
'discord' => 'fab fa-discord',
|
||||||
$social_icons = array(
|
'youtube' => 'fab fa-youtube',
|
||||||
'discord' => 'fab fa-discord',
|
'twitter' => 'fab fa-x-twitter', // Neues Icon für Twitter/X
|
||||||
'youtube' => 'fab fa-youtube',
|
'facebook' => 'fab fa-facebook-f',
|
||||||
'twitter' => 'fab fa-x-twitter', // Neues Icon für Twitter/X
|
'instagram' => 'fab fa-instagram',
|
||||||
'facebook' => 'fab fa-facebook-f',
|
'tiktok' => 'fab fa-tiktok',
|
||||||
'instagram' => 'fab fa-instagram',
|
'twitch' => 'fab fa-twitch',
|
||||||
'tiktok' => 'fab fa-tiktok',
|
'steam' => 'fab fa-steam',
|
||||||
'twitch' => 'fab fa-twitch',
|
'github' => 'fab fa-github',
|
||||||
'steam' => 'fab fa-steam',
|
'linkedin' => 'fab fa-linkedin-in',
|
||||||
'github' => 'fab fa-github',
|
'pinterest' => 'fab fa-pinterest-p',
|
||||||
'linkedin' => 'fab fa-linkedin-in',
|
'reddit' => 'fab fa-reddit-alien',
|
||||||
'pinterest' => 'fab fa-pinterest-p',
|
'teamspeak' => 'fab fa-teamspeak',
|
||||||
'reddit' => 'fab fa-reddit-alien',
|
'spotify' => 'fab fa-spotify'
|
||||||
'teamspeak' => 'fab fa-teamspeak',
|
);
|
||||||
'spotify' => 'fab fa-spotify'
|
|
||||||
);
|
// Schleife, die alle verfügbaren Icons durchgeht
|
||||||
|
foreach ($social_icons as $key => $class) {
|
||||||
// Schleife, die alle verfügbaren Icons durchgeht
|
// Prüfen, ob für diese Plattform eine URL im Customizer hinterlegt wurde
|
||||||
foreach ($social_icons as $key => $class) {
|
if (get_theme_mod('social_' . $key)) {
|
||||||
// Prüfen, ob für diese Plattform eine URL im Customizer hinterlegt wurde
|
// Wenn ja, Link und Icon ausgeben
|
||||||
if (get_theme_mod('social_' . $key)) {
|
echo '<a href="' . esc_url(get_theme_mod('social_' . $key)) . '" target="_blank"><i class="' . esc_attr($class) . '"></i></a>';
|
||||||
// Wenn ja, Link und Icon ausgeben
|
}
|
||||||
echo '<a href="' . esc_url(get_theme_mod('social_' . $key)) . '" target="_blank"><i class="' . esc_attr($class) . '"></i></a>';
|
}
|
||||||
}
|
?>
|
||||||
}
|
</div>
|
||||||
?>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
@@ -1,258 +1,341 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function minecraft_modern_customize_register( $wp_customize ) {
|
function minecraft_modern_customize_register( $wp_customize ) {
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 1. HEADER-BEREICH ===================================================
|
// === 1. HEADER-BEREICH ===================================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
// --- Sektion: Header Slider ---
|
// --- Sektion: Header Slider ---
|
||||||
$wp_customize->add_section( 'header_slider', array(
|
$wp_customize->add_section( 'header_slider', array(
|
||||||
'title' => 'Header Slider',
|
'title' => 'Header Slider',
|
||||||
'priority' => 20,
|
'priority' => 20,
|
||||||
'description' => 'Konfiguriere den großen Slider auf der Startseite.',
|
'description' => 'Konfiguriere den großen Slider auf der Startseite.',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Checkbox zum Aktivieren des Sliders
|
// Checkbox zum Aktivieren des Sliders
|
||||||
$wp_customize->add_setting( 'slider_enabled', array(
|
$wp_customize->add_setting( 'slider_enabled', array(
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'transport' => 'refresh',
|
'transport' => 'refresh',
|
||||||
'sanitize_callback' => 'wp_validate_boolean',
|
'sanitize_callback' => 'wp_validate_boolean',
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_control( 'slider_enabled', array(
|
$wp_customize->add_control( 'slider_enabled', array(
|
||||||
'label' => 'Header Slider aktivieren',
|
'label' => 'Header Slider aktivieren',
|
||||||
'section' => 'header_slider',
|
'section' => 'header_slider',
|
||||||
'settings' => 'slider_enabled',
|
'settings' => 'slider_enabled',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// Dynamische Slider-Bilder, Titel und Untertitel
|
// Dynamische Slider-Bilder, Titel und Untertitel
|
||||||
for ($i = 1; $i <= 5; $i++) {
|
for ($i = 1; $i <= 5; $i++) {
|
||||||
$wp_customize->add_setting( 'slider_image_' . $i, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
$wp_customize->add_setting( 'slider_image_' . $i, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_' . $i, array(
|
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'slider_image_' . $i, array(
|
||||||
'label' => sprintf( 'Banner %d - Bild', $i ),
|
'label' => sprintf( 'Banner %d - Bild', $i ),
|
||||||
'section' => 'header_slider',
|
'section' => 'header_slider',
|
||||||
'settings' => 'slider_image_' . $i,
|
'settings' => 'slider_image_' . $i,
|
||||||
) ) );
|
) ) );
|
||||||
|
|
||||||
$wp_customize->add_setting( 'slider_title_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
$wp_customize->add_setting( 'slider_title_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_control( 'slider_title_' . $i, array(
|
$wp_customize->add_control( 'slider_title_' . $i, array(
|
||||||
'label' => sprintf( 'Banner %d - Titel', $i ),
|
'label' => sprintf( 'Banner %d - Titel', $i ),
|
||||||
'section' => 'header_slider',
|
'section' => 'header_slider',
|
||||||
'settings' => 'slider_title_' . $i,
|
'settings' => 'slider_title_' . $i,
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$wp_customize->add_setting( 'slider_subtitle_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
$wp_customize->add_setting( 'slider_subtitle_' . $i, array( 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_control( 'slider_subtitle_' . $i, array(
|
$wp_customize->add_control( 'slider_subtitle_' . $i, array(
|
||||||
'label' => sprintf( 'Banner %d - Untertitel', $i ),
|
'label' => sprintf( 'Banner %d - Untertitel', $i ),
|
||||||
'section' => 'header_slider',
|
'section' => 'header_slider',
|
||||||
'settings' => 'slider_subtitle_' . $i,
|
'settings' => 'slider_subtitle_' . $i,
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slider Text- & Stil-Einstellungen
|
// Slider Text- & Stil-Einstellungen
|
||||||
$wp_customize->add_setting( 'slider_font_family', array( 'default' => 'Raleway', 'sanitize_callback' => 'sanitize_text_field' ) );
|
$wp_customize->add_setting( 'slider_font_family', array( 'default' => 'Raleway', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_control( 'slider_font_family', array(
|
$wp_customize->add_control( 'slider_font_family', array(
|
||||||
'label' => 'Schriftart', 'section' => 'header_slider', 'settings' => 'slider_font_family', 'type' => 'select',
|
'label' => 'Schriftart', 'section' => 'header_slider', 'settings' => 'slider_font_family', 'type' => 'select',
|
||||||
'choices' => array( 'Raleway' => 'Raleway', 'Poppins' => 'Poppins', 'Montserrat' => 'Montserrat', 'Oswald' => 'Oswald', 'Roboto' => 'Roboto', 'Lato' => 'Lato' ),
|
'choices' => array( 'Raleway' => 'Raleway', 'Poppins' => 'Poppins', 'Montserrat' => 'Montserrat', 'Oswald' => 'Oswald', 'Roboto' => 'Roboto', 'Lato' => 'Lato' ),
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_setting( 'slider_font_size', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
$wp_customize->add_setting( 'slider_font_size', array( 'default' => 'mittel', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_control( 'slider_font_size', array(
|
$wp_customize->add_control( 'slider_font_size', array(
|
||||||
'label' => 'Schriftgröße', 'section' => 'header_slider', 'settings' => 'slider_font_size', 'type' => 'select',
|
'label' => 'Schriftgröße', 'section' => 'header_slider', 'settings' => 'slider_font_size', 'type' => 'select',
|
||||||
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß', 'extra-gross' => 'Extra Groß' ),
|
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß', 'extra-gross' => 'Extra Groß' ),
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_setting( 'slider_font_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color' ) );
|
$wp_customize->add_setting( 'slider_font_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color' ) );
|
||||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'slider_font_color', array(
|
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'slider_font_color', array(
|
||||||
'label' => 'Schriftfarbe', 'section' => 'header_slider', 'settings' => 'slider_font_color',
|
'label' => 'Schriftfarbe', 'section' => 'header_slider', 'settings' => 'slider_font_color',
|
||||||
) ) );
|
) ) );
|
||||||
|
|
||||||
// === VERGESSENE EINSTELLUNG WIEDER HINZUGEFÜGT ===
|
// === VERGESSENE EINSTELLUNG WIEDER HINZUGEFÜGT ===
|
||||||
$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',
|
||||||
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß' ),
|
'choices' => array( 'klein' => 'Klein', 'mittel' => 'Mittel', 'gross' => 'Groß' ),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
$wp_customize->add_setting( 'slider_hide_arrows', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
$wp_customize->add_setting( 'slider_hide_arrows', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||||
$wp_customize->add_control( 'slider_hide_arrows', array(
|
$wp_customize->add_control( 'slider_hide_arrows', array(
|
||||||
'label' => 'Pfeile ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_arrows', 'type' => 'checkbox',
|
'label' => 'Pfeile ausblenden', 'section' => 'header_slider', 'settings' => 'slider_hide_arrows', 'type' => 'checkbox',
|
||||||
) );
|
) );
|
||||||
$wp_customize->add_setting( 'slider_hide_pagination', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
$wp_customize->add_setting( 'slider_hide_pagination', array( 'default' => false, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||||
$wp_customize->add_control( 'slider_hide_pagination', array(
|
$wp_customize->add_control( 'slider_hide_pagination', array(
|
||||||
'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',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
// =========================================================================
|
||||||
// --- Sektion: Startseiten-Hero (Fallback) ---
|
// === ENTFERNT: Slider-Effekt-Einstellungen ==============================
|
||||||
$wp_customize->add_section( 'hero_section', array(
|
// =========================================================================
|
||||||
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
|
|
||||||
'priority' => 21,
|
// --- Sektion: Startseiten-Hero (Fallback) ---
|
||||||
'description' => 'Diese Inhalte werden angezeigt, wenn der Slider ausgeschaltet ist.',
|
$wp_customize->add_section( 'hero_section', array(
|
||||||
) );
|
'title' => 'Startseiten-Hero (wenn Slider deaktiviert)',
|
||||||
$wp_customize->add_setting( 'hero_title', array( 'default' => 'Willkommen auf unserem Server', 'sanitize_callback' => 'sanitize_text_field' ) );
|
'priority' => 21,
|
||||||
$wp_customize->add_control( 'hero_title', array( 'label' => 'Haupttitel', 'section' => 'hero_section', 'settings' => 'hero_title', 'type' => 'text' ) );
|
'description' => 'Diese Inhalte werden angezeigt, wenn der Slider ausgeschaltet ist.',
|
||||||
$wp_customize->add_setting( 'hero_subtitle', array( 'default' => 'Trete einer Community voller Abenteuer bei.', 'sanitize_callback' => 'sanitize_text_field' ) );
|
) );
|
||||||
$wp_customize->add_control( 'hero_subtitle', array( 'label' => 'Untertitel', 'section' => 'hero_section', 'settings' => 'hero_subtitle', 'type' => 'text' ) );
|
$wp_customize->add_setting( 'hero_title', array( 'default' => 'Willkommen auf unserem Server', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_setting( 'hero_bg_image', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
$wp_customize->add_control( 'hero_title', array( 'label' => 'Haupttitel', 'section' => 'hero_section', 'settings' => 'hero_title', 'type' => 'text' ) );
|
||||||
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_bg_image', array(
|
$wp_customize->add_setting( 'hero_subtitle', array( 'default' => 'Trete einer Community voller Abenteuer bei.', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
'label' => 'Hintergrundbild', 'section' => 'hero_section', 'settings' => 'hero_bg_image',
|
$wp_customize->add_control( 'hero_subtitle', array( 'label' => 'Untertitel', 'section' => 'hero_section', 'settings' => 'hero_subtitle', 'type' => 'text' ) );
|
||||||
) ) );
|
$wp_customize->add_setting( 'hero_bg_image', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||||
$wp_customize->add_setting( 'hero_button_1_text', array( 'default' => 'Zum Forum', 'sanitize_callback' => 'sanitize_text_field' ) );
|
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'hero_bg_image', array(
|
||||||
$wp_customize->add_control( 'hero_button_1_text', array( 'label' => 'Button 1 Text', 'section' => 'hero_section', 'settings' => 'hero_button_1_text', 'type' => 'text' ) );
|
'label' => 'Hintergrundbild', 'section' => 'hero_section', 'settings' => 'hero_bg_image',
|
||||||
$wp_customize->add_setting( 'hero_button_1_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw' ) );
|
) ) );
|
||||||
$wp_customize->add_control( 'hero_button_1_url', array( 'label' => 'Button 1 URL', 'section' => 'hero_section', 'settings' => 'hero_button_1_url', 'type' => 'url' ) );
|
$wp_customize->add_setting( 'hero_button_1_text', array( 'default' => 'Zum Forum', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
$wp_customize->add_setting( 'hero_button_2_text', array( 'default' => 'Zum Teamspeak', 'sanitize_callback' => 'sanitize_text_field' ) );
|
$wp_customize->add_control( 'hero_button_1_text', array( 'label' => 'Button 1 Text', 'section' => 'hero_section', 'settings' => 'hero_button_1_text', 'type' => 'text' ) );
|
||||||
$wp_customize->add_control( 'hero_button_2_text', array( 'label' => 'Button 2 Text', 'section' => 'hero_section', 'settings' => 'hero_button_2_text', 'type' => 'text' ) );
|
$wp_customize->add_setting( 'hero_button_1_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_1_url', array( 'label' => 'Button 1 URL', 'section' => 'hero_section', 'settings' => 'hero_button_1_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' ) );
|
$wp_customize->add_setting( 'hero_button_2_text', array( 'default' => 'Zum Teamspeak', 'sanitize_callback' => 'sanitize_text_field' ) );
|
||||||
|
$wp_customize->add_control( 'hero_button_2_text', array( 'label' => 'Button 2 Text', 'section' => 'hero_section', 'settings' => 'hero_button_2_text', 'type' => 'text' ) );
|
||||||
|
$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' ) );
|
||||||
// === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================
|
|
||||||
// =========================================================================
|
|
||||||
|
// =========================================================================
|
||||||
// --- Sektion: Farben & Darstellung ---
|
// === 2. FARBEN & DARSTELLUNG (KOMBINIERT) ================================
|
||||||
$wp_customize->add_section( 'theme_appearance_settings', array(
|
// =========================================================================
|
||||||
'title' => 'Farben & Darstellung',
|
|
||||||
'priority' => 30,
|
// --- Sektion: Farben & Darstellung ---
|
||||||
) );
|
$wp_customize->add_section( 'theme_appearance_settings', array(
|
||||||
|
'title' => 'Farben & Darstellung',
|
||||||
// Akzentfarbe
|
'priority' => 30,
|
||||||
$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(
|
|
||||||
'label' => 'Akzentfarbe', 'section' => 'theme_appearance_settings', 'settings' => 'primary_accent_color',
|
// Akzentfarbe
|
||||||
) ) );
|
$wp_customize->add_setting( 'primary_accent_color', array( 'default' => '#00d4ff', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh' ) );
|
||||||
|
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'primary_accent_color', array(
|
||||||
// Hintergrundfarbe
|
'label' => 'Akzentfarbe', 'section' => 'theme_appearance_settings', 'settings' => 'primary_accent_color',
|
||||||
$wp_customize->add_setting( 'background_color', array(
|
) ) );
|
||||||
'default' => '#ffffff',
|
|
||||||
'sanitize_callback' => 'sanitize_hex_color',
|
// Hintergrundfarbe
|
||||||
'transport' => 'refresh',
|
$wp_customize->add_setting( 'background_color', array(
|
||||||
) );
|
'default' => '#ffffff',
|
||||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
|
'sanitize_callback' => 'sanitize_hex_color',
|
||||||
'label' => 'Hintergrundfarbe',
|
'transport' => 'refresh',
|
||||||
'section' => 'theme_appearance_settings',
|
) );
|
||||||
'settings' => 'background_color',
|
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'background_color', array(
|
||||||
) ) );
|
'label' => 'Hintergrundfarbe',
|
||||||
|
'section' => 'theme_appearance_settings',
|
||||||
// Dark / Light Mode
|
'settings' => 'background_color',
|
||||||
$wp_customize->add_setting( 'default_theme_mode', array( 'default' => 'dark', 'sanitize_callback' => 'sanitize_key' ) );
|
) ) );
|
||||||
$wp_customize->add_control( 'default_theme_mode', array(
|
|
||||||
'label' => 'Standard-Theme-Modus', 'section' => 'theme_appearance_settings', 'type' => 'radio',
|
// Dark / Light Mode
|
||||||
'choices' => array( 'dark' => 'Dark Mode (Standard)', 'light' => 'Light Mode' ),
|
$wp_customize->add_setting( 'default_theme_mode', array( 'default' => 'dark', 'sanitize_callback' => 'sanitize_key' ) );
|
||||||
) );
|
$wp_customize->add_control( 'default_theme_mode', array(
|
||||||
|
'label' => 'Standard-Theme-Modus', 'section' => 'theme_appearance_settings', 'type' => 'radio',
|
||||||
|
'choices' => array( 'dark' => 'Dark Mode (Standard)', 'light' => 'Light Mode' ),
|
||||||
// =========================================================================
|
) );
|
||||||
// === 3. SOCIAL MEDIA =====================================================
|
|
||||||
// =========================================================================
|
|
||||||
|
// =========================================================================
|
||||||
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
|
// === 3. SOCIAL MEDIA =====================================================
|
||||||
$social_platforms = array( 'discord' => 'Discord', 'youtube' => 'YouTube', 'twitter' => 'Twitter (X)', 'facebook' => 'Facebook', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', 'twitch' => 'Twitch', 'steam' => 'Steam', 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', 'teamspeak' => 'Teamspeak', 'spotify' => 'Spotify' );
|
// =========================================================================
|
||||||
foreach ($social_platforms as $key => $label) {
|
|
||||||
$wp_customize->add_setting( 'social_' . $key, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
|
||||||
$wp_customize->add_control( 'social_' . $key, array(
|
$social_platforms = array( 'discord' => 'Discord', 'youtube' => 'YouTube', 'twitter' => 'Twitter (X)', 'facebook' => 'Facebook', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', 'twitch' => 'Twitch', 'steam' => 'Steam', 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'pinterest' => 'Pinterest', 'reddit' => 'Reddit', 'teamspeak' => 'Teamspeak', 'spotify' => 'Spotify' );
|
||||||
'label' => $label . ' URL', 'section' => 'social_links', 'settings' => 'social_' . $key, 'type' => 'url',
|
foreach ($social_platforms as $key => $label) {
|
||||||
) );
|
$wp_customize->add_setting( 'social_' . $key, array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||||
}
|
$wp_customize->add_control( 'social_' . $key, array(
|
||||||
|
'label' => $label . ' URL', 'section' => 'social_links', 'settings' => 'social_' . $key, 'type' => 'url',
|
||||||
|
) );
|
||||||
// =========================================================================
|
}
|
||||||
// === 4. FOOTER-BEREICH ==================================================
|
|
||||||
// =========================================================================
|
|
||||||
|
// =========================================================================
|
||||||
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
|
// === 4. FOOTER-BEREICH ==================================================
|
||||||
|
// =========================================================================
|
||||||
// Copyright-Text
|
|
||||||
$wp_customize->add_setting( 'footer_copyright', array( 'default' => '© ' . date('Y') . ' ' . get_bloginfo('name'), 'sanitize_callback' => 'wp_kses_post' ) );
|
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
|
||||||
$wp_customize->add_control( 'footer_copyright', array(
|
|
||||||
'label' => 'Copyright-Text', 'section' => 'footer_settings', 'settings' => 'footer_copyright', 'type' => 'textarea',
|
// Copyright-Text
|
||||||
) );
|
$wp_customize->add_setting( 'footer_copyright', array( 'default' => '© ' . date('Y') . ' ' . get_bloginfo('name'), 'sanitize_callback' => 'wp_kses_post' ) );
|
||||||
|
$wp_customize->add_control( 'footer_copyright', array(
|
||||||
// Impressum & Datenschutz Links
|
'label' => 'Copyright-Text', 'section' => 'footer_settings', 'settings' => 'footer_copyright', 'type' => 'textarea',
|
||||||
$wp_customize->add_setting( 'footer_impressum_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
) );
|
||||||
$wp_customize->add_control( 'footer_impressum_url', array(
|
|
||||||
'label' => 'URL für Impressum', 'section' => 'footer_settings', 'settings' => 'footer_impressum_url', 'type' => 'url',
|
// Impressum & Datenschutz Links
|
||||||
) );
|
$wp_customize->add_setting( 'footer_impressum_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||||
$wp_customize->add_setting( 'footer_datenschutz_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
$wp_customize->add_control( 'footer_impressum_url', array(
|
||||||
$wp_customize->add_control( 'footer_datenschutz_url', array(
|
'label' => 'URL für Impressum', 'section' => 'footer_settings', 'settings' => 'footer_impressum_url', 'type' => 'url',
|
||||||
'label' => 'URL für Datenschutz', 'section' => 'footer_settings', 'settings' => 'footer_datenschutz_url', 'type' => 'url',
|
) );
|
||||||
) );
|
$wp_customize->add_setting( 'footer_datenschutz_url', array( 'sanitize_callback' => 'esc_url_raw' ) );
|
||||||
|
$wp_customize->add_control( 'footer_datenschutz_url', array(
|
||||||
// Footer-Credit
|
'label' => 'URL für Datenschutz', 'section' => 'footer_settings', 'settings' => 'footer_datenschutz_url', 'type' => 'url',
|
||||||
$wp_customize->add_setting( 'show_footer_credit', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
) );
|
||||||
$wp_customize->add_control( 'show_footer_credit', array(
|
|
||||||
'label' => 'Footer-Credit ("Minecraft Theme Erstellt von...") anzeigen', 'section' => 'footer_settings', 'settings' => 'show_footer_credit', 'type' => 'checkbox',
|
// Footer-Credit
|
||||||
) );
|
$wp_customize->add_setting( 'show_footer_credit', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||||
|
$wp_customize->add_control( 'show_footer_credit', array(
|
||||||
|
'label' => 'Footer-Credit ("Minecraft Theme Erstellt von...") anzeigen', 'section' => 'footer_settings', 'settings' => 'show_footer_credit', 'type' => 'checkbox',
|
||||||
// =========================================================================
|
) );
|
||||||
// === 5. ZUSÄTZLICHE FUNKTIONEN ==========================================
|
|
||||||
// =========================================================================
|
|
||||||
|
// =========================================================================
|
||||||
// --- Sektion: FAQ Einstellungen ---
|
// === 5. ZUSÄTZLICHE FUNKTIONEN ==========================================
|
||||||
$wp_customize->add_section( 'faq_settings', array( 'title' => 'FAQ Einstellungen', 'priority' => 60 ) );
|
// =========================================================================
|
||||||
$wp_customize->add_setting( 'faq_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
|
||||||
$wp_customize->add_control( 'faq_enabled', array(
|
// --- Sektion: FAQ Einstellungen ---
|
||||||
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
|
$wp_customize->add_section( 'faq_settings', array( 'title' => 'FAQ Einstellungen', 'priority' => 60 ) );
|
||||||
) );
|
$wp_customize->add_setting( 'faq_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||||
|
$wp_customize->add_control( 'faq_enabled', array(
|
||||||
}
|
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
|
||||||
add_action( 'customize_register', 'minecraft_modern_customize_register' );
|
) );
|
||||||
|
|
||||||
|
// =========================================================================
|
||||||
// =========================================================================
|
// === 6. LOGIN-BEREICH ====================================================
|
||||||
// === DYNAMISCHES CSS =====================================================
|
// =========================================================================
|
||||||
// =========================================================================
|
|
||||||
|
$wp_customize->add_section( 'login_settings', array(
|
||||||
// Diese Funktion bleibt unverändert, da sie bereits gut strukturiert ist.
|
'title' => 'Login-Einstellungen',
|
||||||
function minecraft_modern_dynamic_css_output() {
|
'priority' => 70,
|
||||||
$accent_color = get_theme_mod( 'primary_accent_color', '#00d4ff' );
|
'description' => 'Passe das Aussehen der wp-admin Login-Seite an.',
|
||||||
$slider_font = get_theme_mod( 'slider_font_family', 'Raleway' );
|
) );
|
||||||
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
|
|
||||||
$slider_size_setting = get_theme_mod( 'slider_font_size', 'mittel' );
|
// Login-Hintergrundbild
|
||||||
$header_height_setting = get_theme_mod( 'header_height', 'mittel' ); // Diese Einstellung wird hier verwendet!
|
$wp_customize->add_setting( 'login_background_image', array(
|
||||||
|
'sanitize_callback' => 'esc_url_raw',
|
||||||
// Header-Höhe umwandeln
|
'transport' => 'refresh',
|
||||||
$header_height_value = '300px';
|
) );
|
||||||
if ( $header_height_setting === 'klein' ) {
|
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_background_image', array(
|
||||||
$header_height_value = '200px';
|
'label' => 'Login-Hintergrundbild',
|
||||||
} elseif ( $header_height_setting === 'gross' ) {
|
'section' => 'login_settings',
|
||||||
$header_height_value = '400px';
|
'settings' => 'login_background_image',
|
||||||
}
|
) ) );
|
||||||
|
|
||||||
// Schriftgrößen umwandeln
|
// Login-Logo
|
||||||
$font_sizes = array(
|
$wp_customize->add_setting( 'login_logo', array(
|
||||||
'klein' => array( 'title' => '2.5rem', 'subtitle' => '1.2rem' ),
|
'sanitize_callback' => 'esc_url_raw',
|
||||||
'mittel' => array( 'title' => '3.5rem', 'subtitle' => '1.4rem' ),
|
'transport' => 'refresh',
|
||||||
'gross' => array( 'title' => '4.5rem', 'subtitle' => '1.6rem' ),
|
) );
|
||||||
'extra-gross' => array( 'title' => '5.5rem', 'subtitle' => '1.8rem' ),
|
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'login_logo', array(
|
||||||
);
|
'label' => 'Login-Logo (ersetzt das WordPress-Logo)',
|
||||||
$chosen_sizes = isset( $font_sizes[$slider_size_setting] ) ? $font_sizes[$slider_size_setting] : $font_sizes['mittel'];
|
'section' => 'login_settings',
|
||||||
|
'settings' => 'login_logo',
|
||||||
$fonts_to_load = array($slider_font);
|
) ) );
|
||||||
$fonts_url = 'https://fonts.googleapis.com/css2?family=' . implode( ':wght@400;600;700&family=', $fonts_to_load ) . '&display=swap';
|
|
||||||
?>
|
// Multi-Avatar UUIDs
|
||||||
|
for ($i = 1; $i <= 5; $i++) {
|
||||||
<link rel="stylesheet" href="<?php echo esc_url($fonts_url); ?>">
|
$wp_customize->add_setting( 'login_avatar_uuid_' . $i, array(
|
||||||
<style type="text/css">
|
'sanitize_callback' => 'sanitize_text_field',
|
||||||
:root {
|
'transport' => 'refresh',
|
||||||
--primary-accent: <?php echo esc_attr($accent_color); ?>;
|
) );
|
||||||
--header-height: <?php echo esc_attr($header_height_value); ?>;
|
$wp_customize->add_control( 'login_avatar_uuid_' . $i, array(
|
||||||
}
|
'label' => sprintf( 'Avatar %d UUID', $i ),
|
||||||
.slider-title, .slider-subtitle, .hero-title, .hero-subtitle, .hero-button-1, .hero-button-2 {
|
'description' => sprintf( 'Gib die UUID für den %d. Avatar an. (Leer lassen, um zu deaktivieren)', $i ),
|
||||||
font-family: '<?php echo esc_attr($slider_font); ?>', sans-serif;
|
'section' => 'login_settings',
|
||||||
color: <?php echo esc_attr($slider_color); ?>;
|
'settings' => 'login_avatar_uuid_' . $i,
|
||||||
}
|
'type' => 'text',
|
||||||
.slider-title, .hero-title {
|
) );
|
||||||
font-size: <?php echo esc_attr($chosen_sizes['title']); ?>;
|
}
|
||||||
}
|
|
||||||
.slider-subtitle, .hero-subtitle {
|
// Slider-Geschwindigkeit
|
||||||
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
|
$wp_customize->add_setting( 'login_avatar_slider_speed', array(
|
||||||
}
|
'default' => 4,
|
||||||
</style>
|
'sanitize_callback' => 'absint',
|
||||||
<?php
|
'transport' => 'refresh',
|
||||||
}
|
) );
|
||||||
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
|
$wp_customize->add_control( 'login_avatar_slider_speed', array(
|
||||||
|
'label' => 'Avatar-Wechsel (in Sekunden)',
|
||||||
|
'description' => 'Wie viele Sekunden soll ein Avatar angezeigt werden?',
|
||||||
|
'section' => 'login_settings',
|
||||||
|
'settings' => 'login_avatar_slider_speed',
|
||||||
|
'type' => 'number',
|
||||||
|
'input_attrs' => array( 'min' => 2, 'max' => 10, 'step' => 1 ),
|
||||||
|
) );
|
||||||
|
}
|
||||||
|
add_action( 'customize_register', 'minecraft_modern_customize_register' );
|
||||||
|
|
||||||
|
|
||||||
|
// =========================================================================
|
||||||
|
// === DYNAMISCHES CSS =====================================================
|
||||||
|
// =========================================================================
|
||||||
|
|
||||||
|
function minecraft_modern_dynamic_css_output() {
|
||||||
|
$accent_color = get_theme_mod( 'primary_accent_color', '#00d4ff' );
|
||||||
|
$slider_font = get_theme_mod( 'slider_font_family', 'Raleway' );
|
||||||
|
$slider_color = get_theme_mod( 'slider_font_color', '#ffffff' );
|
||||||
|
$slider_size_setting = get_theme_mod( 'slider_font_size', 'mittel' );
|
||||||
|
$header_height_setting = get_theme_mod( 'header_height', 'mittel' ); // Diese Einstellung wird hier verwendet!
|
||||||
|
|
||||||
|
// Header-Höhe umwandeln
|
||||||
|
$header_height_value = '300px';
|
||||||
|
if ( $header_height_setting === 'klein' ) {
|
||||||
|
$header_height_value = '200px';
|
||||||
|
} elseif ( $header_height_setting === 'gross' ) {
|
||||||
|
$header_height_value = '400px';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Schriftgrößen umwandeln
|
||||||
|
$font_sizes = array(
|
||||||
|
'klein' => array( 'title' => '2.5rem', 'subtitle' => '1.2rem' ),
|
||||||
|
'mittel' => array( 'title' => '3.5rem', 'subtitle' => '1.4rem' ),
|
||||||
|
'gross' => array( 'title' => '4.5rem', 'subtitle' => '1.6rem' ),
|
||||||
|
'extra-gross' => array( 'title' => '5.5rem', 'subtitle' => '1.8rem' ),
|
||||||
|
);
|
||||||
|
$chosen_sizes = isset( $font_sizes[$slider_size_setting] ) ? $font_sizes[$slider_size_setting] : $font_sizes['mittel'];
|
||||||
|
|
||||||
|
$fonts_to_load = array($slider_font);
|
||||||
|
$fonts_url = 'https://fonts.googleapis.com/css2?family=' . implode( ':wght@400;600;700&family=', $fonts_to_load ) . '&display=swap';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="<?php echo esc_url($fonts_url); ?>">
|
||||||
|
<style type="text/css">
|
||||||
|
:root {
|
||||||
|
--primary-accent: <?php echo esc_attr($accent_color); ?>;
|
||||||
|
--header-height: <?php echo esc_attr($header_height_value); ?>;
|
||||||
|
}
|
||||||
|
.slider-title, .slider-subtitle, .hero-title, .hero-subtitle, .hero-button-1, .hero-button-2 {
|
||||||
|
font-family: '<?php echo esc_attr($slider_font); ?>', sans-serif;
|
||||||
|
color: <?php echo esc_attr($slider_color); ?>;
|
||||||
|
}
|
||||||
|
.slider-title, .hero-title {
|
||||||
|
font-size: <?php echo esc_attr($chosen_sizes['title']); ?>;
|
||||||
|
}
|
||||||
|
.slider-subtitle, .hero-subtitle {
|
||||||
|
font-size: <?php echo esc_attr($chosen_sizes['subtitle']); ?>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =================================================================== */
|
||||||
|
/* === NEU: Trennlinien mit der Akzentfarbe ========================= */
|
||||||
|
/* =================================================================== */
|
||||||
|
|
||||||
|
/* Trennlinie unter dem Header */
|
||||||
|
.site-header {
|
||||||
|
border-bottom: 4px solid var(--primary-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Trennlinie unter dem Slider */
|
||||||
|
.hero-slider {
|
||||||
|
border-bottom: 4px solid var(--primary-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Trennlinie am oberen Rand des Footers */
|
||||||
|
.site-footer {
|
||||||
|
border-top: 4px solid var(--primary-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
add_action( 'wp_head', 'minecraft_modern_dynamic_css_output' );
|
||||||
19
Minecraft-Modern-Theme/js/login-script.js
Normal file
19
Minecraft-Modern-Theme/js/login-script.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
jQuery(document).ready(function($) {
|
||||||
|
// Warte, bis das DOM vollständig geladen ist
|
||||||
|
// Wir erstellen einen Wrapper um den Avatar-Slider und das Formular, um das Flexbox-Layout zu ermöglichen.
|
||||||
|
const avatar = $('#minecraft-avatar-slider');
|
||||||
|
const form = $('#loginform');
|
||||||
|
|
||||||
|
// Nur ausführen, wenn beide Elemente existieren
|
||||||
|
if (avatar.length && form.length) {
|
||||||
|
// Erstelle einen neuen Wrapper-Div
|
||||||
|
const wrapper = $('<div id="login-content-wrapper"></div>');
|
||||||
|
|
||||||
|
// Füge den Wrapper vor dem Formular in den #login Container ein
|
||||||
|
form.before(wrapper);
|
||||||
|
|
||||||
|
// Verschiebe den Avatar-Slider und das Formular in den Wrapper
|
||||||
|
wrapper.append(avatar);
|
||||||
|
wrapper.append(form);
|
||||||
|
}
|
||||||
|
});
|
||||||
25
Minecraft-Modern-Theme/js/login-slider.js
Normal file
25
Minecraft-Modern-Theme/js/login-slider.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
jQuery(document).ready(function($) {
|
||||||
|
const slider = $('#minecraft-avatar-slider');
|
||||||
|
const slides = slider.find('.avatar-slide');
|
||||||
|
|
||||||
|
// Nur starten, wenn es mehr als einen Slide gibt
|
||||||
|
if (slides.length > 1) {
|
||||||
|
let currentIndex = 0;
|
||||||
|
|
||||||
|
function showSlide(index) {
|
||||||
|
slides.removeClass('avatar-slide-active');
|
||||||
|
slides.eq(index).addClass('avatar-slide-active');
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextSlide() {
|
||||||
|
currentIndex = (currentIndex + 1) % slides.length;
|
||||||
|
showSlide(currentIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Geschwindigkeit aus den WordPress-Einstellungen holen
|
||||||
|
const speed = avatarSliderSettings.speed || 4000;
|
||||||
|
|
||||||
|
// Den Slider alle X Sekunden wechseln
|
||||||
|
setInterval(nextSlide, speed);
|
||||||
|
}
|
||||||
|
});
|
||||||
30
Minecraft-Modern-Theme/js/scroll-to-top.js
Normal file
30
Minecraft-Modern-Theme/js/scroll-to-top.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
jQuery(document).ready(function($) {
|
||||||
|
// Wähle den Button aus
|
||||||
|
var scrollButton = $('#scroll-to-top');
|
||||||
|
|
||||||
|
// Funktion zum Anzeigen oder Verstecken des Buttons
|
||||||
|
function toggleScrollButton() {
|
||||||
|
// Wenn mehr als 300px gescrollt wurde, zeige den Button
|
||||||
|
if ($(window).scrollTop() > 300) {
|
||||||
|
scrollButton.addClass('show');
|
||||||
|
} else {
|
||||||
|
scrollButton.removeClass('show');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event Listener für das Scrollen
|
||||||
|
$(window).on('scroll', function() {
|
||||||
|
toggleScrollButton();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Event Listener für den Klick auf den Button
|
||||||
|
scrollButton.on('click', function(e) {
|
||||||
|
// Verhindere das Standardverhalten des Links
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// Scrolle die Seite sanft nach oben
|
||||||
|
$('html, body').animate({
|
||||||
|
scrollTop: 0
|
||||||
|
}, 800); // 800ms für eine sanfte Animation
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,55 +1,52 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Hole den Slider-Container
|
// Hole den Slider-Container
|
||||||
const heroSlider = document.querySelector('.hero-slider');
|
const heroSlider = document.querySelector('.hero-slider');
|
||||||
|
|
||||||
// Stelle sicher, dass der Slider auf der Seite existiert, bevor du versuchst, ihn zu konfigurieren
|
// Stelle sicher, dass der Slider auf der Seite existiert
|
||||||
if (!heroSlider) {
|
if (!heroSlider) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Konfiguration für den Slider vorbereiten
|
// Konfiguration für den Slider vorbereiten
|
||||||
const swiperConfig = {
|
const swiperConfig = {
|
||||||
// Optionen für den Slider
|
// Der Effekt ist jetzt fest auf "Überblenden" eingestellt
|
||||||
loop: true, // Endloses Schleifen
|
effect: 'fade',
|
||||||
|
fadeEffect: {
|
||||||
// Autoplay
|
crossFade: true
|
||||||
autoplay: {
|
},
|
||||||
delay: 5000, // 5 Sekunden pro Slide
|
|
||||||
disableOnInteraction: false, // Autoplay nicht nach Klick stoppen
|
// Loop-Einstellung ist jetzt DYNAMISCH
|
||||||
},
|
loop: sliderSettings.loop === '1',
|
||||||
|
|
||||||
// Wenn der Nutzer die Maus darüber bewegt, pausieren
|
// Autoplay
|
||||||
pauseOnMouseEnter: true,
|
autoplay: {
|
||||||
|
delay: 5000,
|
||||||
// Effekt
|
disableOnInteraction: false,
|
||||||
effect: 'fade', // Übergangseffekt: 'slide', 'fade', 'cube', etc.
|
},
|
||||||
fadeEffect: {
|
|
||||||
crossFade: true
|
pauseOnMouseEnter: true,
|
||||||
}
|
|
||||||
};
|
// Prüfe, ob die Pfeile NICHT ausgeblendet werden sollen
|
||||||
|
navigation: sliderSettings.hideArrows !== '1' ? {
|
||||||
// Prüfe, ob die Pfeile ausgeblendet werden sollen
|
nextEl: '.swiper-button-next',
|
||||||
if (sliderSettings.hideArrows === '1') {
|
prevEl: '.swiper-button-prev',
|
||||||
heroSlider.classList.add('slider-hide-arrows');
|
} : false,
|
||||||
} else {
|
|
||||||
// Navigation nur hinzufügen, wenn sie nicht ausgeblendet wird
|
// Prüfe, ob die Paginierung NICHT ausgeblendet werden soll
|
||||||
swiperConfig.navigation = {
|
pagination: sliderSettings.hidePagination !== '1' ? {
|
||||||
nextEl: '.swiper-button-next',
|
el: '.swiper-pagination',
|
||||||
prevEl: '.swiper-button-prev',
|
clickable: true,
|
||||||
};
|
} : false,
|
||||||
}
|
|
||||||
|
on: {
|
||||||
// Prüfe, ob die Paginierung ausgeblendet werden soll
|
init: function () {
|
||||||
if (sliderSettings.hidePagination === '1') {
|
setTimeout(() => {
|
||||||
heroSlider.classList.add('slider-hide-pagination');
|
heroSlider.classList.add('swiper-initialized');
|
||||||
} else {
|
}, 50);
|
||||||
// Pagination nur hinzufügen, wenn sie nicht ausgeblendet wird
|
},
|
||||||
swiperConfig.pagination = {
|
},
|
||||||
el: '.swiper-pagination',
|
};
|
||||||
clickable: true, // Klick auf Punkt springt zum Slide
|
|
||||||
};
|
// Initialisiere den Slider mit der konfigurierten Optionen
|
||||||
}
|
new Swiper('.hero-slider', swiperConfig);
|
||||||
|
|
||||||
// Initialisiere den Slider mit der konfigurierten Optionen
|
|
||||||
new Swiper('.hero-slider', swiperConfig);
|
|
||||||
});
|
});
|
||||||
84
Minecraft-Modern-Theme/page-login.php
Normal file
84
Minecraft-Modern-Theme/page-login.php
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
Template Name: Benutzerdefinierte Authentifizierungsseite
|
||||||
|
*/
|
||||||
|
|
||||||
|
get_header(); ?>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div id="primary" class="content-area">
|
||||||
|
<main id="main" class="site-main">
|
||||||
|
<div class="custom-auth-container">
|
||||||
|
<?php if (is_user_logged_in()) : ?>
|
||||||
|
<!-- Wenn der Benutzer angemeldet ist, zeige eine Nachricht und einen Logout-Link -->
|
||||||
|
<div class="logged-in-message">
|
||||||
|
<h2>Willkommen zurück, <?php echo esc_html(wp_get_current_user()->display_name); ?>!</h2>
|
||||||
|
<p>Du bist bereits angemeldet.</p>
|
||||||
|
<p>
|
||||||
|
<a href="<?php echo esc_url(wp_logout_url(home_url())); ?>" class="button">Abmelden</a>
|
||||||
|
<a href="<?php echo esc_url(admin_url()); ?>" class="button">Zum Dashboard</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<?php else : ?>
|
||||||
|
<!-- Wenn der Benutzer nicht angemeldet ist, zeige das Registrierungsformular -->
|
||||||
|
<h1 class="auth-title">Willkommen auf <?php bloginfo('name'); ?></h1>
|
||||||
|
<p class="auth-subtitle">Erstelle deinen Account und werde Teil unserer Community!</p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Zeige das Registrierungsformular an
|
||||||
|
$args = array(
|
||||||
|
'echo' => true,
|
||||||
|
'redirect' => home_url('/login/?checkemail=registered'), // Weiterleitung nach der Registrierung
|
||||||
|
'form_id' => 'custom_registerform',
|
||||||
|
'label_username' => __( 'Benutzername' ),
|
||||||
|
'label_email' => __( 'E-Mail-Adresse' ),
|
||||||
|
'label_password' => __( 'Passwort' ),
|
||||||
|
'label_remember' => __( 'Angemeldet bleiben' ),
|
||||||
|
'label_log_in' => __( 'Registrieren' ),
|
||||||
|
'id_username' => 'user_login',
|
||||||
|
'id_email' => 'user_email',
|
||||||
|
'id_password' => 'user_pass',
|
||||||
|
'id_remember' => 'rememberme',
|
||||||
|
'id_submit' => 'wp-submit',
|
||||||
|
'remember' => true,
|
||||||
|
'value_username' => NULL,
|
||||||
|
'value_remember' => false
|
||||||
|
);
|
||||||
|
wp_register_form($args);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="login-form-link">
|
||||||
|
<p>Schon hast du einen Account? <a href="<?php echo esc_url(wp_login_url()); ?>">Hier anmelden</a>.</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Hintergrundbild aus dem Customizer holen und als Inline-CSS ausgeben
|
||||||
|
$auth_bg_image = get_theme_mod('login_background_image');
|
||||||
|
if ($auth_bg_image):
|
||||||
|
?>
|
||||||
|
<style>
|
||||||
|
body.login, body.login-action-register {
|
||||||
|
background-image: url('<?php echo esc_url($auth_bg_image); ?>') !important;
|
||||||
|
background-size: cover !important;
|
||||||
|
background-position: center !important;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
}
|
||||||
|
body.login::before, body.login-action-register::before {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(20, 21, 26, 0.8);
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php get_footer(); ?>
|
||||||
BIN
Minecraft-Modern-Theme/screenshot.PNG
Normal file
BIN
Minecraft-Modern-Theme/screenshot.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
File diff suppressed because it is too large
Load Diff
100
README.md
100
README.md
@@ -1,2 +1,100 @@
|
|||||||
# Minecraft-Modern-Theme
|
# Minecraft Modern Theme
|
||||||
|
|
||||||
|
Ein modernes und flexibles WordPress-Theme, perfekt für Minecraft-Server, Gaming-Communities und Gamer-Blogs. Passe deine Seite mit wenigen Klicks ganz nach deinem Stil an!
|
||||||
|
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/raw/branch/main/Minecraft-Modern-Theme/screenshot.PNG" alt="Theme Screenshot" style="max-width: 500px; width: 100%; height: auto; border-radius: 8px;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Hauptfunktionen
|
||||||
|
|
||||||
|
- **🎨 Dynamischer Header-Slider:** Zeige bis zu 5 beeindruckende Banner mit individuellem Text, Effekten und Animationen.
|
||||||
|
- **🌙 Dark & Light Mode:** Lass deine Besucher zwischen einem dunklen und einem hellen Design wählen.
|
||||||
|
- **🎨 Komplette Farbanpassung:** Wähle deine eigene Akzentfarbe und Hintergrundfarbe, um dein Branding perfekt abzubilden.
|
||||||
|
- **🌐 Social Media Integration:** Verlinke einfach all deine Kanäle (Discord, YouTube, Twitter, TikTok und viele mehr).
|
||||||
|
- **📄 Eigenes FAQ-System:** Erstelle und verwalte eine eigene FAQ-Seite direkt im WordPress-Menü, ohne zusätzliche Plugins.
|
||||||
|
- **🔐 Angepasste Login-Seite:** Gestalte die Login-Seite mit deinem eigenen Logo, Hintergrund und einem coolen Minecraft-Avatar-Slider.
|
||||||
|
- **⬆️ "Nach oben"-Button:** Ein praktischer Button, der deinen Besuchern das Scrollen erleichtert.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Installation (in 3 einfachen Schritten)
|
||||||
|
|
||||||
|
1. **Lade das Theme herunter:** Lade die `minecraft-modern.zip`-Datei herunter.
|
||||||
|
2. **Lade es in WordPress hoch:**
|
||||||
|
* Gehe in deinem WordPress-Adminbereich zu **Design > Themes > Installieren**.
|
||||||
|
* Klicke auf den Button **Theme hochladen**.
|
||||||
|
* Wähle die heruntergeladene `minecraft-modern.zip`-Datei aus und installiere sie.
|
||||||
|
3. **Aktiviere das Theme:** Klicke nach der Installation auf **Aktivieren**. Fertig!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 👶 Wichtig: Nutze das Child Theme!
|
||||||
|
|
||||||
|
Wenn du planst, Anpassungen vorzunehmen (z.B. Farben per Code ändern oder PHP-Dateien bearbeiten), solltest du unbedingt das mitgelieferte **Child Theme** verwenden.
|
||||||
|
|
||||||
|
**Warum?** Damit deine persönlichen Anpassungen bei einem Theme-Update nicht überschrieben werden!
|
||||||
|
|
||||||
|
### Installation des Child Themes (Der einfache Weg)
|
||||||
|
|
||||||
|
1. **Lade das Child Theme herunter:** Lade die `minecraft-modern-child.zip`-Datei herunter.
|
||||||
|
2. **Lade es in WordPress hoch:**
|
||||||
|
* Gehe zu **Design > Themes > Installieren**.
|
||||||
|
* Klicke auf **Theme hochladen**.
|
||||||
|
* Wähle die `minecraft-modern-child.zip`-Datei aus und installiere sie.
|
||||||
|
3. **Aktiviere das Child Theme:** Klicke auf **Aktivieren**.
|
||||||
|
|
||||||
|
**Wichtig:** Das Haupt-Theme (Minecraft Modern) muss weiterhin installiert bleiben, darf aber nicht aktiviert sein. WordPress erkennt dies automatisch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚙️ So passt du dein Theme an
|
||||||
|
|
||||||
|
Gehe in deinem WordPress-Dashboard zu **Design > Anpassen**, um in die Einstellungen zu gelangen.
|
||||||
|
|
||||||
|
### 1. Header-Slider einrichten
|
||||||
|
|
||||||
|
Unter dem Punkt **Header Slider** kannst du:
|
||||||
|
- Den Slider mit einem Haken aktivieren.
|
||||||
|
- Bis zu 5 **Bilder, Titel und Untertitel** hochladen.
|
||||||
|
- Die **Schriftart, -größe und -farbe** anpassen.
|
||||||
|
- Einen **Effekt** auswählen (z.B. Überblenden oder Würfel).
|
||||||
|
- Die **Pfeile** oder **Punkte** zur Navigation ausblenden.
|
||||||
|
|
||||||
|
### 2. Farben & Design auswählen
|
||||||
|
|
||||||
|
Unter **Farben & Darstellung** findest du:
|
||||||
|
- **Akzentfarbe:** Die Hauptfarbe deines Themes (wird für Buttons, Links etc. verwendet).
|
||||||
|
- **Hintergrundfarbe:** Die Farbe des Seitenhintergrunds.
|
||||||
|
- **Standard-Theme-Modus:** Entscheide, ob deine Seite standardmäßig im Dark- oder Light-Mode starten soll.
|
||||||
|
|
||||||
|
### 3. Social-Media-Links hinzufügen
|
||||||
|
|
||||||
|
Im Menüpunkt **Social Media Links** kannst du bei den jeweiligen Plattformen einfach deine URL eintragen. Die Icons erscheinen dann automatisch an der vorgesehenen Stelle.
|
||||||
|
|
||||||
|
### 4. Footer anpassen
|
||||||
|
|
||||||
|
Unter **Footer-Einstellungen** kannst du:
|
||||||
|
- Den **Copyright-Text** ändern.
|
||||||
|
- Die URLs für dein **Impressum** und die **Datenschutz**-Seite einfügen.
|
||||||
|
- Den "Erstellt von"-Verweis am Ende der Seite ausblenden.
|
||||||
|
|
||||||
|
### 5. FAQs erstellen
|
||||||
|
|
||||||
|
1. Gehe zu **FAQ Einstellungen** und setze einen Haken bei "FAQ System aktivieren".
|
||||||
|
2. Das Theme erstellt automatisch eine neue Seite namens "FAQ" und einen neuen Menüpunkt **FAQs** in deinem WordPress-Dashboard.
|
||||||
|
3. Unter **FAQs > Neue FAQ hinzufügen** kannst du jetzt deine Fragen und Antworten erstellen. Du kannst sie sogar in Kategorien sortieren!
|
||||||
|
|
||||||
|
### 6. Login-Seite gestalten
|
||||||
|
|
||||||
|
Unter **Login-Einstellungen** kannst du:
|
||||||
|
- Ein **Hintergrundbild** und ein **Logo** für die Login-Seite hochladen.
|
||||||
|
- Bis zu 5 **Minecraft-Avatar-UUIDs** eintragen, um einen dynamischen Avatar-Slider zu erzeugen. (Eine UUID findest du z.B. auf [minotar.net](https://minotar.net/)).
|
||||||
|
- Die **Geschwindigkeit** des Avatar-Wechsels einstellen.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Viel Spaß mit deinem neuen Theme! 🎮✨
|
||||||
Reference in New Issue
Block a user