Minecraft-Modern-Theme/front-page.php aktualisiert
This commit is contained in:
@@ -1,80 +1,92 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php
|
||||
if ( get_theme_mod('slider_enabled', false) ) :
|
||||
?>
|
||||
<section class="hero-slider swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
for ($i = 1; $i <= 5; $i++) :
|
||||
$image_url = get_theme_mod('slider_image_' . $i);
|
||||
if ($image_url) :
|
||||
$title = get_theme_mod('slider_title_' . $i);
|
||||
$subtitle = get_theme_mod('slider_subtitle_' . $i);
|
||||
?>
|
||||
<div class="swiper-slide" style="background-image: url('<?php echo esc_url($image_url); ?>');">
|
||||
<div class="slider-content">
|
||||
<?php if ($title) : ?>
|
||||
<h2 class="slider-title"><?php echo esc_html($title); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php if ($subtitle) : ?>
|
||||
<p class="slider-subtitle"><?php echo esc_html($subtitle); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
endfor;
|
||||
?>
|
||||
</div>
|
||||
<div class="swiper-pagination"></div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
</section>
|
||||
<?php else : ?>
|
||||
<?php
|
||||
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
||||
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
||||
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
||||
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
||||
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
||||
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
||||
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
||||
?>
|
||||
<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) . "')" : ''; ?>">
|
||||
<div class="container">
|
||||
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
|
||||
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
|
||||
<div class="hero-buttons">
|
||||
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
|
||||
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<main id="primary" class="site-main">
|
||||
<div class="container">
|
||||
<div class="content-area">
|
||||
<?php if ( have_posts() ) : 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-excerpt">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; else : ?>
|
||||
<p><?php _e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php get_header(); ?>
|
||||
|
||||
<?php
|
||||
if ( get_theme_mod('slider_enabled', false) ) :
|
||||
?>
|
||||
<section class="hero-slider swiper-container">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
for ($i = 1; $i <= 5; $i++) :
|
||||
$image_url = get_theme_mod('slider_image_' . $i);
|
||||
if ($image_url) :
|
||||
$title = get_theme_mod('slider_title_' . $i);
|
||||
$subtitle = get_theme_mod('slider_subtitle_' . $i);
|
||||
?>
|
||||
<div class="swiper-slide" style="background-image: url('<?php echo esc_url($image_url); ?>');">
|
||||
<div class="slider-content">
|
||||
<?php if ($title) : ?>
|
||||
<h2 class="slider-title"><?php echo esc_html($title); ?></h2>
|
||||
<?php endif; ?>
|
||||
<?php if ($subtitle) : ?>
|
||||
<p class="slider-subtitle"><?php echo esc_html($subtitle); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
endfor;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Nur anzeigen, wenn die Paginierung NICHT ausgeblendet ist -->
|
||||
<?php if ( ! get_theme_mod('slider_hide_pagination', false) ) : ?>
|
||||
<div class="swiper-pagination"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Nur anzeigen, wenn die Pfeile NICHT ausgeblendet sind -->
|
||||
<?php if ( ! get_theme_mod('slider_hide_arrows', false) ) : ?>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
</section>
|
||||
<?php else : ?>
|
||||
<?php
|
||||
$hero_bg = get_theme_mod( 'hero_bg_image' );
|
||||
$hero_title = get_theme_mod( 'hero_title', 'Willkommen auf unserem Server' );
|
||||
$hero_subtitle = get_theme_mod( 'hero_subtitle', 'Trete einer Community voller Abenteuer bei.' );
|
||||
$btn1_text = get_theme_mod( 'hero_button_1_text', 'Zum Forum' );
|
||||
$btn1_url = get_theme_mod( 'hero_button_1_url', '#' );
|
||||
$btn2_text = get_theme_mod( 'hero_button_2_text', 'Zum Teamspeak' );
|
||||
$btn2_url = get_theme_mod( 'hero_button_2_url', '#' );
|
||||
?>
|
||||
<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) . "')" : ''; ?>">
|
||||
<div class="container">
|
||||
<h1 class="hero-title"><?php echo esc_html($hero_title); ?></h1>
|
||||
<p class="hero-subtitle"><?php echo esc_html($hero_subtitle); ?></p>
|
||||
<div class="hero-buttons">
|
||||
<a href="<?php echo esc_url($btn1_url); ?>" class="hero-button-1"><?php echo esc_html($btn1_text); ?></a>
|
||||
<a href="<?php echo esc_url($btn2_url); ?>" class="hero-button-2"><?php echo esc_html($btn2_text); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<main id="primary" class="site-main">
|
||||
<div class="container">
|
||||
<div class="content-area">
|
||||
<?php if ( have_posts() ) : 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>
|
||||
<!-- =================================================================== -->
|
||||
<!-- === 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(); ?>
|
||||
Reference in New Issue
Block a user