Minecraft-Modern-Theme/front-page.php aktualisiert

This commit is contained in:
2025-11-29 21:55:18 +00:00
parent 32bbb0b36f
commit f25fbf3869

View File

@@ -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(); ?>