Upload front-page.php via GUI

This commit is contained in:
2026-01-09 19:45:46 +00:00
parent fab5f1464c
commit b0d7f44d9a

View File

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