Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9df80d7237 | |||
| 27f6a15aae | |||
| 638808d9dd | |||
| ca9815ea65 | |||
| 568acd83d1 | |||
| 985ba164a1 | |||
| 77536986ab | |||
| 39e9b298d9 | |||
| 37b31a6109 | |||
| b7276ff373 | |||
| 02b94594b9 | |||
| d76950645e | |||
| dbea7c74f3 | |||
| ae10138d51 | |||
| 991d9c38c8 | |||
| 4ad76fabf6 | |||
| d46684dc7e | |||
| dc14b838d6 | |||
| f397108cf0 | |||
| 6896f6aa26 | |||
| e119411758 | |||
| 50c636a17f | |||
| 9051f74598 | |||
| 777a999fed | |||
| d27c2b1259 | |||
| cc36e57079 | |||
| ca6955d579 | |||
| ddbf78a5c0 | |||
| b3638449ea | |||
| 863deb2592 |
@@ -1,47 +1,47 @@
|
|||||||
<?php get_header(); ?>
|
<?php get_header(); ?>
|
||||||
|
|
||||||
<div class="container site-main">
|
<div class="container site-main">
|
||||||
<div class="content-area">
|
<div class="content-area">
|
||||||
<div class="team-archive-container">
|
<div class="team-archive-container">
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
<h1 class="page-title">Unser Team</h1>
|
<h1 class="page-title">Unser Team</h1>
|
||||||
<p class="page-description">Lerne die Leute kennen, die diesen Server am Laufen halten.</p>
|
<p class="page-description">Lerne die Leute kennen, die diesen Server am Laufen halten.</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$query = new WP_Query(array('post_type' => 'team_member', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'));
|
$query = new WP_Query(array('post_type' => 'team_member', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC'));
|
||||||
if ( $query->have_posts() ) : ?>
|
if ( $query->have_posts() ) : ?>
|
||||||
<div class="team-grid">
|
<div class="team-grid">
|
||||||
<?php while ( $query->have_posts() ) : $query->the_post();
|
<?php while ( $query->have_posts() ) : $query->the_post();
|
||||||
$rank_string = get_post_meta( get_the_ID(), '_team_member_rank', true );
|
$rank_string = get_post_meta( get_the_ID(), '_team_member_rank', true );
|
||||||
$img = get_the_post_thumbnail_url( get_the_ID(), 'medium' );
|
$img = get_the_post_thumbnail_url( get_the_ID(), 'medium' );
|
||||||
if ( !$img ) $img = get_template_directory_uri() . '/images/default-avatar.png';
|
if ( !$img ) $img = get_template_directory_uri() . '/images/default-avatar.png';
|
||||||
?>
|
?>
|
||||||
<article class="team-card">
|
<article class="team-card">
|
||||||
<div class="team-image-wrapper">
|
<div class="team-image-wrapper">
|
||||||
<img src="<?php echo esc_url($img); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">
|
<img src="<?php echo esc_url($img); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="team-info">
|
<div class="team-info">
|
||||||
<h3 class="team-name"><?php the_title(); ?></h3>
|
<h3 class="team-name"><?php the_title(); ?></h3>
|
||||||
<div class="team-ranks-wrapper">
|
<div class="team-ranks-wrapper">
|
||||||
<?php if ( !empty($rank_string) ) {
|
<?php if ( !empty($rank_string) ) {
|
||||||
$ranks = explode(',', $rank_string);
|
$ranks = explode(',', $rank_string);
|
||||||
foreach ( $ranks as $r ) {
|
foreach ( $ranks as $r ) {
|
||||||
echo '<span class="team-rank">' . esc_html(trim($r)) . '</span>';
|
echo '<span class="team-rank">' . esc_html(trim($r)) . '</span>';
|
||||||
}
|
}
|
||||||
} ?>
|
} ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="team-bio"><?php the_excerpt(); ?></div>
|
<div class="team-bio"><?php the_excerpt(); ?></div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php wp_reset_postdata(); ?>
|
<?php wp_reset_postdata(); ?>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<p>Noch keine Teammitglieder.</p>
|
<p>Noch keine Teammitglieder.</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
<?php get_footer(); ?>
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Entfernt das Sticky-Verhalten der Sidebar komplett */
|
||||||
|
.homepage-sidebar {
|
||||||
|
position: relative !important;
|
||||||
|
top: auto !important;
|
||||||
|
background: var(--card-background, #1e2029);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 20px;
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: calc(200vh - 10vh);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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(); ?>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,7 @@
|
|||||||
* - Social Media
|
* - Social Media
|
||||||
* - Footer
|
* - Footer
|
||||||
* - Login
|
* - Login
|
||||||
|
* - Sidebar
|
||||||
* - Import/Export
|
* - Import/Export
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -198,7 +199,47 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 3. SOCIAL MEDIA =====================================================
|
// === 3. SIDEBAR EINSTELLUNGEN ============================================
|
||||||
|
// =========================================================================
|
||||||
|
|
||||||
|
$wp_customize->add_section( 'sidebar_settings', array(
|
||||||
|
'title' => 'Sidebar Einstellungen',
|
||||||
|
'priority' => 35,
|
||||||
|
'description' => 'Konfiguriere die Sidebar auf der Startseite.',
|
||||||
|
) );
|
||||||
|
|
||||||
|
// Sidebar aktivieren
|
||||||
|
$wp_customize->add_setting( 'homepage_sidebar_enabled', array(
|
||||||
|
'default' => false,
|
||||||
|
'sanitize_callback' => 'wp_validate_boolean',
|
||||||
|
) );
|
||||||
|
$wp_customize->add_control( 'homepage_sidebar_enabled', array(
|
||||||
|
'label' => 'Sidebar auf Startseite aktivieren',
|
||||||
|
'description' => 'Zeigt eine Sidebar neben dem Hauptinhalt an.',
|
||||||
|
'section' => 'sidebar_settings',
|
||||||
|
'settings' => 'homepage_sidebar_enabled',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
) );
|
||||||
|
|
||||||
|
// Sidebar Position
|
||||||
|
$wp_customize->add_setting( 'homepage_sidebar_position', array(
|
||||||
|
'default' => 'right',
|
||||||
|
'sanitize_callback' => 'sanitize_key',
|
||||||
|
) );
|
||||||
|
$wp_customize->add_control( 'homepage_sidebar_position', array(
|
||||||
|
'label' => 'Sidebar Position',
|
||||||
|
'section' => 'sidebar_settings',
|
||||||
|
'settings' => 'homepage_sidebar_position',
|
||||||
|
'type' => 'select',
|
||||||
|
'choices' => array(
|
||||||
|
'left' => 'Links',
|
||||||
|
'right' => 'Rechts',
|
||||||
|
),
|
||||||
|
) );
|
||||||
|
|
||||||
|
|
||||||
|
// =========================================================================
|
||||||
|
// === 4. SOCIAL MEDIA =====================================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
|
$wp_customize->add_section( 'social_links', array( 'title' => 'Social Media Links', 'priority' => 40 ) );
|
||||||
@@ -212,7 +253,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 4. FOOTER-BEREICH ==================================================
|
// === 5. FOOTER-BEREICH ==================================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
|
$wp_customize->add_section( 'footer_settings', array( 'title' => 'Footer-Einstellungen', 'priority' => 50 ) );
|
||||||
@@ -241,7 +282,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 5. ZUSÄTZLICHE FUNKTIONEN ==========================================
|
// === 6. ZUSÄTZLICHE FUNKTIONEN ==========================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
// --- Sektion: FAQ Einstellungen ---
|
// --- Sektion: FAQ Einstellungen ---
|
||||||
@@ -251,7 +292,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
|
'label' => 'FAQ System aktivieren', 'section' => 'faq_settings', 'settings' => 'faq_enabled', 'type' => 'checkbox',
|
||||||
) );
|
) );
|
||||||
|
|
||||||
// --- Sektion: Team Einstellungen ---
|
// --- Sektion: Team Einstellungen ---
|
||||||
$wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) );
|
$wp_customize->add_section( 'team_settings', array( 'title' => 'Team Einstellungen', 'priority' => 65 ) );
|
||||||
$wp_customize->add_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
$wp_customize->add_setting( 'team_enabled', array( 'default' => true, 'sanitize_callback' => 'wp_validate_boolean' ) );
|
||||||
$wp_customize->add_control( 'team_enabled', array(
|
$wp_customize->add_control( 'team_enabled', array(
|
||||||
@@ -259,7 +300,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
) );
|
) );
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 6. LOGIN-BEREICH ====================================================
|
// === 7. LOGIN-BEREICH ====================================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
$wp_customize->add_section( 'login_settings', array(
|
$wp_customize->add_section( 'login_settings', array(
|
||||||
@@ -321,7 +362,7 @@ function minecraft_modern_customize_register( $wp_customize ) {
|
|||||||
) );
|
) );
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// === 7. EXPORT / IMPORT SECTION =========================================
|
// === 8. EXPORT / IMPORT SECTION =========================================
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
$wp_customize->add_section( 'theme_mods_import_export', array(
|
$wp_customize->add_section( 'theme_mods_import_export', array(
|
||||||
|
|||||||
@@ -5,8 +5,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// === ZENTRALE VERSIONSKONSTANTE ===
|
// === THEME VERSION AUTOMATISCH AUS style.css LADEN (PARENT THEME PRIORITÄT) ===
|
||||||
define( 'MINECRAFT_MODERN_THEME_VERSION', '1.6' );
|
function minecraft_modern_get_theme_version() {
|
||||||
|
// Holt das aktuell aktive Theme (child oder parent)
|
||||||
|
$theme = wp_get_theme();
|
||||||
|
|
||||||
|
// Wenn ein Child-Theme aktiv ist und ein Parent vorhanden ist, nutze die Parent-Version
|
||||||
|
$parent = $theme->parent();
|
||||||
|
if ( $parent && $parent->exists() ) {
|
||||||
|
$parent_version = $parent->get( 'Version' );
|
||||||
|
if ( ! empty( $parent_version ) ) {
|
||||||
|
return $parent_version;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback: Version des aktuell aktiven Themes (wenn kein Parent existiert oder Parent keine Version hat)
|
||||||
|
return $theme->get( 'Version' );
|
||||||
|
}
|
||||||
|
|
||||||
// === THEME UPDATE NOTIFICATION SYSTEM ===
|
// === THEME UPDATE NOTIFICATION SYSTEM ===
|
||||||
|
|
||||||
@@ -34,7 +49,10 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
|
|||||||
|
|
||||||
if ( false === $release_info ) {
|
if ( false === $release_info ) {
|
||||||
// Timeout auf 10 Sekunden erhöht für langsame Verbindungen
|
// Timeout auf 10 Sekunden erhöht für langsame Verbindungen
|
||||||
$response = wp_remote_get( 'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest', array( 'timeout' => 10 ) );
|
$response = wp_remote_get(
|
||||||
|
'https://git.viper.ipv64.net/api/v1/repos/M_Viper/Minecraft-Modern-Theme/releases/latest',
|
||||||
|
array( 'timeout' => 10 )
|
||||||
|
);
|
||||||
|
|
||||||
if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) {
|
if ( ! is_wp_error( $response ) && 200 === wp_remote_retrieve_response_code( $response ) ) {
|
||||||
$body = wp_remote_retrieve_body( $response );
|
$body = wp_remote_retrieve_body( $response );
|
||||||
@@ -54,7 +72,7 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
|
|||||||
'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : ''
|
'published_at' => isset( $release_data['published_at'] ) ? $release_data['published_at'] : ''
|
||||||
);
|
);
|
||||||
|
|
||||||
// Cache für 6 Stunden (kannst du anpassen)
|
// Cache für 6 Stunden
|
||||||
set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS );
|
set_transient( $transient_key, $release_info, 6 * HOUR_IN_SECONDS );
|
||||||
} else {
|
} else {
|
||||||
// Fehlerhafte Daten leer cachen
|
// Fehlerhafte Daten leer cachen
|
||||||
@@ -69,13 +87,13 @@ function minecraft_modern_get_latest_release_info( $force_refresh = false ) {
|
|||||||
return $release_info;
|
return $release_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Benachrichtigung im Admin-Bereich
|
// === BENACHRICHTIGUNG IM ADMIN-BEREICH ===
|
||||||
function minecraft_modern_show_update_notification() {
|
function minecraft_modern_show_update_notification() {
|
||||||
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
if ( ! is_admin() || ! current_user_can( 'manage_options' ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$current_version = MINECRAFT_MODERN_THEME_VERSION;
|
$current_version = minecraft_modern_get_theme_version();
|
||||||
$latest_release = minecraft_modern_get_latest_release_info();
|
$latest_release = minecraft_modern_get_latest_release_info();
|
||||||
|
|
||||||
if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) {
|
if ( ! empty( $latest_release ) && isset( $latest_release['version'] ) && version_compare( $current_version, $latest_release['version'], '<' ) ) {
|
||||||
@@ -105,7 +123,7 @@ function minecraft_modern_show_update_notification() {
|
|||||||
}
|
}
|
||||||
add_action( 'admin_notices', 'minecraft_modern_show_update_notification' );
|
add_action( 'admin_notices', 'minecraft_modern_show_update_notification' );
|
||||||
|
|
||||||
// Dashboard Widget
|
// === DASHBOARD WIDGET ===
|
||||||
function minecraft_modern_add_dashboard_widget() {
|
function minecraft_modern_add_dashboard_widget() {
|
||||||
wp_add_dashboard_widget(
|
wp_add_dashboard_widget(
|
||||||
'minecraft_modern_update_widget',
|
'minecraft_modern_update_widget',
|
||||||
@@ -116,7 +134,7 @@ function minecraft_modern_add_dashboard_widget() {
|
|||||||
add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' );
|
add_action( 'wp_dashboard_setup', 'minecraft_modern_add_dashboard_widget' );
|
||||||
|
|
||||||
function minecraft_modern_update_widget_function() {
|
function minecraft_modern_update_widget_function() {
|
||||||
$current_version = MINECRAFT_MODERN_THEME_VERSION;
|
$current_version = minecraft_modern_get_theme_version();
|
||||||
$latest_release = minecraft_modern_get_latest_release_info();
|
$latest_release = minecraft_modern_get_latest_release_info();
|
||||||
|
|
||||||
echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>';
|
echo '<p><strong>' . __( 'Current Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $current_version ) . '</p>';
|
||||||
@@ -125,18 +143,18 @@ function minecraft_modern_update_widget_function() {
|
|||||||
echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>';
|
echo '<p><strong>' . __( 'Latest Version:', 'minecraft-modern-theme' ) . '</strong> ' . esc_html( $latest_release['version'] ) . '</p>';
|
||||||
|
|
||||||
if ( version_compare( $current_version, $latest_release['version'], '<' ) ) {
|
if ( version_compare( $current_version, $latest_release['version'], '<' ) ) {
|
||||||
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color: #d63638;">' . __( 'Update Available', 'minecraft-modern-theme' ) . '</span></p>';
|
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#d63638;">' . __( 'Update Available', 'minecraft-modern-theme' ) . '</span></p>';
|
||||||
echo '<p><a href="' . esc_url( $latest_release['download_url'] ) . '" class="button button-primary" target="_blank">' . __( 'Download Update', 'minecraft-modern-theme' ) . '</a></p>';
|
echo '<p><a href="' . esc_url( $latest_release['download_url'] ) . '" class="button button-primary" target="_blank">' . __( 'Download Update', 'minecraft-modern-theme' ) . '</a></p>';
|
||||||
} else {
|
} else {
|
||||||
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color: #46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>';
|
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> <span style="color:#46b450;">' . __( 'Up to Date', 'minecraft-modern-theme' ) . '</span></p>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>';
|
echo '<p><strong>' . __( 'Status:', 'minecraft-modern-theme' ) . '</strong> ' . __( 'Unable to check for updates', 'minecraft-modern-theme' ) . '</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Link für "Jetzt prüfen" hinzugefügt
|
// Link für "Jetzt prüfen"
|
||||||
$refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' );
|
$refresh_url = wp_nonce_url( admin_url( 'index.php?mm_clear_cache=1' ), 'mm_clear_cache_action' );
|
||||||
echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></p>';
|
echo '<p><a href="' . esc_url( $refresh_url ) . '" onclick="return confirm(\'Cache leeren und neu prüfen?\');">' . __( 'Check for Updates Now', 'minecraft-modern-theme' ) . '</a></p>';
|
||||||
|
|
||||||
echo '<p><a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" target="_blank">' . __( 'View All Releases', 'minecraft-modern-theme' ) . '</a></p>';
|
echo '<p><a href="https://git.viper.ipv64.net/M_Viper/Minecraft-Modern-Theme/releases" target="_blank">' . __( 'View All Releases', 'minecraft-modern-theme' ) . '</a></p>';
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user