Upload front-page.php via GUI

This commit is contained in:
2026-02-10 22:25:54 +00:00
parent 777a999fed
commit 9051f74598

View File

@@ -88,48 +88,329 @@ if ( get_theme_mod('slider_enabled', false) ) :
<?php endif; ?> <?php endif; ?>
<!-- ===================================================== --> <!-- ===================================================== -->
<!-- MAIN CONTENT --> <!-- MAIN CONTENT MIT SIDEBAR -->
<!-- ===================================================== --> <!-- ===================================================== -->
<main id="primary" class="site-main"> <main id="primary" class="site-main">
<div class="container"> <div class="container">
<div class="content-area">
<?php
// Hole Sidebar-Einstellungen
$sidebar_enabled = get_theme_mod( 'homepage_sidebar_enabled', false );
$sidebar_position = get_theme_mod( 'homepage_sidebar_position', 'right' );
// Prüfe ob mindestens ein Sidebar-Bereich aktiv ist
$has_sidebar_content = (
is_active_sidebar( 'homepage-sidebar-top' ) ||
is_active_sidebar( 'homepage-sidebar-middle-1' ) ||
is_active_sidebar( 'homepage-sidebar-middle-2' ) ||
is_active_sidebar( 'homepage-sidebar-bottom' ) ||
is_active_sidebar( 'homepage-sidebar-extra' )
);
// Setze CSS-Klassen basierend auf Sidebar-Status
$content_class = 'content-area';
if ( $sidebar_enabled && $has_sidebar_content ) {
$content_class = 'content-area with-sidebar sidebar-' . esc_attr( $sidebar_position );
}
?>
<?php if ( have_posts() ) : ?> <div class="<?php echo esc_attr( $content_class ); ?>">
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( $sidebar_enabled && $sidebar_position === 'left' && $has_sidebar_content ) : ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>> <!-- SIDEBAR LINKS -->
<aside class="homepage-sidebar sidebar-left">
<?php if ( has_post_thumbnail() ) : ?> <?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
<div class="post-thumbnail"> <div class="sidebar-section sidebar-top">
<a href="<?php the_permalink(); ?>"> <?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
<?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> </div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
<div class="sidebar-section sidebar-middle-1">
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
<div class="sidebar-section sidebar-middle-2">
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
<div class="sidebar-section sidebar-bottom">
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
<div class="sidebar-section sidebar-extra">
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
</div>
<?php endif; ?>
</aside>
<?php endif; ?>
</article> <!-- HAUPTINHALT -->
<div class="main-content">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php endwhile; ?> <article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
<?php else : ?>
<p><?php esc_html_e( 'Keine Beiträge gefunden.', 'minecraft-modern-theme' ); ?></p> <?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>
<?php if ( $sidebar_enabled && $sidebar_position === 'right' && $has_sidebar_content ) : ?>
<!-- SIDEBAR RECHTS -->
<aside class="homepage-sidebar sidebar-right">
<?php if ( is_active_sidebar( 'homepage-sidebar-top' ) ) : ?>
<div class="sidebar-section sidebar-top">
<?php dynamic_sidebar( 'homepage-sidebar-top' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-1' ) ) : ?>
<div class="sidebar-section sidebar-middle-1">
<?php dynamic_sidebar( 'homepage-sidebar-middle-1' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-middle-2' ) ) : ?>
<div class="sidebar-section sidebar-middle-2">
<?php dynamic_sidebar( 'homepage-sidebar-middle-2' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-bottom' ) ) : ?>
<div class="sidebar-section sidebar-bottom">
<?php dynamic_sidebar( 'homepage-sidebar-bottom' ); ?>
</div>
<?php endif; ?>
<?php if ( is_active_sidebar( 'homepage-sidebar-extra' ) ) : ?>
<div class="sidebar-section sidebar-extra">
<?php dynamic_sidebar( 'homepage-sidebar-extra' ); ?>
</div>
<?php endif; ?>
</aside>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</main> </main>
<?php get_footer(); ?> <!-- ===================================================== -->
<!-- ZUSÄTZLICHES CSS FÜR SIDEBAR LAYOUT -->
<!-- ===================================================== -->
<style>
/* Content ohne Sidebar - volle Breite */
.content-area .main-content {
width: 100%;
margin-bottom: 40px;
}
/* Container mit Sidebar-Layout */
.content-area.with-sidebar {
display: grid;
gap: 30px;
align-items: start;
}
/* Sidebar rechts (Standard) */
.content-area.with-sidebar.sidebar-right {
grid-template-columns: 1fr 300px;
}
.content-area.with-sidebar.sidebar-right .main-content {
order: 1;
}
.content-area.with-sidebar.sidebar-right .homepage-sidebar {
order: 2;
}
/* Sidebar links */
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 300px 1fr;
}
.content-area.with-sidebar.sidebar-left .homepage-sidebar {
order: 1;
}
.content-area.with-sidebar.sidebar-left .main-content {
order: 2;
}
/* Sidebar Styling */
.homepage-sidebar {
background: var(--card-background, #1e2029);
border-radius: 8px;
padding: 20px;
position: sticky;
top: 100px; /* Sticky Sidebar */
max-height: none;
overflow-y: visible;
}
/* Sidebar Sections - Bereiche innerhalb der Sidebar */
.homepage-sidebar .sidebar-section {
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar .sidebar-section:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
/* Spezielle Styling für bestimmte Bereiche */
.homepage-sidebar .sidebar-top {
border-bottom: 2px solid var(--primary-accent, #00d4ff);
}
.homepage-sidebar .sidebar-bottom {
padding-top: 20px;
border-top: 2px solid var(--primary-accent, #00d4ff);
border-bottom: none;
}
.homepage-sidebar .widget {
margin-bottom: 20px;
}
.homepage-sidebar .widget:last-child {
margin-bottom: 0;
}
.homepage-sidebar .widget-title {
font-size: 1.2rem;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 2px solid var(--primary-accent, #00d4ff);
color: var(--primary-accent, #00d4ff);
}
.homepage-sidebar ul {
list-style: none;
padding: 0;
margin: 0;
}
.homepage-sidebar ul li {
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.homepage-sidebar ul li:last-child {
border-bottom: none;
}
.homepage-sidebar a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.homepage-sidebar a:hover {
color: var(--primary-accent, #00d4ff);
}
/* Mobile: Sidebar unter Content */
@media (max-width: 768px) {
.content-area.with-sidebar.sidebar-right,
.content-area.with-sidebar.sidebar-left {
grid-template-columns: 1fr;
}
.content-area.with-sidebar .homepage-sidebar {
order: 3 !important; /* Immer unten auf mobilen Geräten */
position: relative;
top: 0;
max-height: none;
}
.content-area.with-sidebar .main-content {
order: 1 !important;
}
}
/* Dark Mode Anpassungen */
body.dark-mode .homepage-sidebar {
background: #1e1e1e;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
body.dark-mode .homepage-sidebar ul li {
border-bottom-color: rgba(255, 255, 255, 0.1);
}
/* Light Mode Anpassungen */
body.light-mode .homepage-sidebar {
background: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .sidebar-section {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar ul li {
border-bottom-color: rgba(0, 0, 0, 0.1);
}
body.light-mode .homepage-sidebar .widget-title {
color: var(--primary-accent, #00d4ff);
}
/* Scrollbar Styling für Sidebar */
.homepage-sidebar::-webkit-scrollbar {
width: 6px;
}
.homepage-sidebar::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb {
background: var(--primary-accent, #00d4ff);
border-radius: 3px;
}
.homepage-sidebar::-webkit-scrollbar-thumb:hover {
background: var(--primary-accent-hover, #00b8e6);
}
</style>
<?php get_footer(); ?>