Upload via Git Manager GUI - archive.php

This commit is contained in:
2026-03-29 20:27:22 +00:00
parent 9c6931d25d
commit 65f6fbb0a2

View File

@@ -1,120 +1,120 @@
<?php get_header(); ?> <?php get_header(); ?>
<main id="primary" class="site-main"> <main id="primary" class="site-main">
<div class="container"> <div class="container">
<div class="content-area"> <div class="content-area">
<header class="archive-header"> <header class="archive-header">
<?php <?php
if ( is_category() ) { if ( is_category() ) {
echo '<div class="archive-type-badge"><i class="fas fa-folder-open"></i> ' . __('Kategorie', 'minecraft-modern-theme') . '</div>'; echo '<div class="archive-type-badge"><i class="fas fa-folder-open"></i> ' . __('Kategorie', 'minecraft-modern-theme') . '</div>';
the_archive_title( '<h1 class="archive-title">', '</h1>' ); the_archive_title( '<h1 class="archive-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' ); the_archive_description( '<div class="archive-description">', '</div>' );
} elseif ( is_tag() ) { } elseif ( is_tag() ) {
echo '<div class="archive-type-badge"><i class="fas fa-hashtag"></i> ' . __('Tag', 'minecraft-modern-theme') . '</div>'; echo '<div class="archive-type-badge"><i class="fas fa-hashtag"></i> ' . __('Tag', 'minecraft-modern-theme') . '</div>';
the_archive_title( '<h1 class="archive-title">', '</h1>' ); the_archive_title( '<h1 class="archive-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' ); the_archive_description( '<div class="archive-description">', '</div>' );
} elseif ( is_author() ) { } elseif ( is_author() ) {
$author = get_queried_object(); $author = get_queried_object();
echo '<div class="archive-type-badge"><i class="fas fa-user"></i> ' . __('Autor', 'minecraft-modern-theme') . '</div>'; echo '<div class="archive-type-badge"><i class="fas fa-user"></i> ' . __('Autor', 'minecraft-modern-theme') . '</div>';
?> ?>
<div class="archive-author-header"> <div class="archive-author-header">
<?php echo get_avatar( $author->ID, 80, '', '', array('class' => 'archive-author-avatar') ); ?> <?php echo get_avatar( $author->ID, 80, '', '', array('class' => 'archive-author-avatar') ); ?>
<div> <div>
<h1 class="archive-title"><?php echo esc_html( $author->display_name ); ?></h1> <h1 class="archive-title"><?php echo esc_html( $author->display_name ); ?></h1>
<?php if ( $author->description ) : ?> <?php if ( $author->description ) : ?>
<p class="archive-description"><?php echo esc_html( $author->description ); ?></p> <p class="archive-description"><?php echo esc_html( $author->description ); ?></p>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<?php <?php
} elseif ( is_date() ) { } elseif ( is_date() ) {
echo '<div class="archive-type-badge"><i class="fas fa-calendar"></i> ' . __('Archiv', 'minecraft-modern-theme') . '</div>'; echo '<div class="archive-type-badge"><i class="fas fa-calendar"></i> ' . __('Archiv', 'minecraft-modern-theme') . '</div>';
the_archive_title( '<h1 class="archive-title">', '</h1>' ); the_archive_title( '<h1 class="archive-title">', '</h1>' );
} else { } else {
the_archive_title( '<h1 class="archive-title">', '</h1>' ); the_archive_title( '<h1 class="archive-title">', '</h1>' );
the_archive_description( '<div class="archive-description">', '</div>' ); the_archive_description( '<div class="archive-description">', '</div>' );
} }
?> ?>
</header> </header>
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<div class="archive-posts-grid"> <div class="archive-posts-grid">
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post archive-post-card'); ?>> <article id="post-<?php the_ID(); ?>" <?php post_class('post archive-post-card'); ?>>
<?php if ( has_post_thumbnail() ) : ?> <?php if ( has_post_thumbnail() ) : ?>
<div class="archive-card-thumb"> <div class="archive-card-thumb">
<a href="<?php the_permalink(); ?>"> <a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('medium_large', array('loading' => 'lazy')); ?> <?php the_post_thumbnail('medium_large', array('loading' => 'lazy')); ?>
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="archive-card-body"> <div class="archive-card-body">
<?php $cats = get_the_category(); if ( $cats ) : ?> <?php $cats = get_the_category(); if ( $cats ) : ?>
<div class="archive-card-cats"> <div class="archive-card-cats">
<a href="<?php echo esc_url( get_category_link( $cats[0]->term_id ) ); ?>" class="post-category-badge"> <a href="<?php echo esc_url( get_category_link( $cats[0]->term_id ) ); ?>" class="post-category-badge">
<?php echo esc_html( $cats[0]->name ); ?> <?php echo esc_html( $cats[0]->name ); ?>
</a> </a>
</div> </div>
<?php endif; ?> <?php endif; ?>
<h2 class="archive-card-title"> <h2 class="archive-card-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2> </h2>
<div class="archive-card-meta"> <div class="archive-card-meta">
<span><i class="fas fa-calendar-alt"></i> <?php echo esc_html( get_the_date() ); ?></span> <span><i class="fas fa-calendar-alt"></i> <?php echo esc_html( get_the_date() ); ?></span>
<span><i class="fas fa-user"></i> <?php the_author(); ?></span> <span><i class="fas fa-user"></i> <?php the_author(); ?></span>
<?php <?php
$wc = str_word_count( strip_tags( get_post_field('post_content', get_the_ID()) ) ); $wc = str_word_count( strip_tags( get_post_field('post_content', get_the_ID()) ) );
$rt = max(1, ceil($wc / 200)); $rt = max(1, ceil($wc / 200));
?> ?>
<span><i class="fas fa-clock"></i> <?php printf( _n('%d Min.', '%d Min.', $rt, 'minecraft-modern-theme'), $rt ); ?></span> <span><i class="fas fa-clock"></i> <?php printf( _n('%d Min.', '%d Min.', $rt, 'minecraft-modern-theme'), $rt ); ?></span>
</div> </div>
<div class="archive-card-excerpt"> <div class="archive-card-excerpt">
<?php the_excerpt(); ?> <?php the_excerpt(); ?>
</div> </div>
<a href="<?php the_permalink(); ?>" class="archive-card-read-more"> <a href="<?php the_permalink(); ?>" class="archive-card-read-more">
<?php _e('Weiterlesen', 'minecraft-modern-theme'); ?> <i class="fas fa-arrow-right"></i> <?php _e('Weiterlesen', 'minecraft-modern-theme'); ?> <i class="fas fa-arrow-right"></i>
</a> </a>
</div> </div>
</article> </article>
<?php endwhile; ?> <?php endwhile; ?>
</div> </div>
<!-- Pagination --> <!-- Pagination -->
<div class="archive-pagination"> <div class="archive-pagination">
<?php <?php
the_posts_pagination( array( the_posts_pagination( array(
'mid_size' => 2, 'mid_size' => 2,
'prev_text' => '<i class="fas fa-chevron-left"></i> ' . __('Zurück', 'minecraft-modern-theme'), 'prev_text' => '<i class="fas fa-chevron-left"></i> ' . __('Zurück', 'minecraft-modern-theme'),
'next_text' => __('Weiter', 'minecraft-modern-theme') . ' <i class="fas fa-chevron-right"></i>', 'next_text' => __('Weiter', 'minecraft-modern-theme') . ' <i class="fas fa-chevron-right"></i>',
'before_page_number' => '<span class="page-num">', 'before_page_number' => '<span class="page-num">',
'after_page_number' => '</span>', 'after_page_number' => '</span>',
) ); ) );
?> ?>
</div> </div>
<?php else : ?> <?php else : ?>
<div class="no-posts-found"> <div class="no-posts-found">
<i class="fas fa-search fa-2x"></i> <i class="fas fa-search fa-2x"></i>
<p><?php _e('Keine Beiträge gefunden.', 'minecraft-modern-theme'); ?></p> <p><?php _e('Keine Beiträge gefunden.', 'minecraft-modern-theme'); ?></p>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
</main> </main>
<?php get_footer(); ?> <?php get_footer(); ?>