Webseite-Freund-des-Spessarts/theme/friends-spessart/archive-news.php

24 lines
1.1 KiB
PHP

<?php get_header(); ?>
<main id="inhalt" class="page-main">
<?php get_template_part( 'parts/page-head', null, array( 'title' => 'Aktuelles', 'kicker' => 'Neues aus dem Spessart', 'wide' => true ) ); ?>
<div class="page-wrap page-wrap--wide">
<div class="news-teasers__grid">
<?php while ( have_posts() ) : the_post(); ?>
<a class="news-teaser<?php echo has_post_thumbnail() ? '' : ' news-teaser--text'; ?>" href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ) : ?>
<div class="news-teaser__image"><?php the_post_thumbnail( 'fds-teaser' ); ?></div>
<?php endif; ?>
<div class="news-teaser__body">
<span class="news-teaser__date"><?php echo esc_html( get_the_date( 'j. F Y' ) ); ?></span>
<h2 class="news-teaser__title"><?php the_title(); ?></h2>
<p class="news-teaser__excerpt"><?php echo esc_html( wp_trim_words( get_the_excerpt(), 20 ) ); ?></p>
<span class="news-teaser__more">Weiterlesen</span>
</div>
</a>
<?php endwhile; ?>
</div>
<?php the_posts_pagination( array( 'prev_text' => '&lsaquo; Neuere', 'next_text' => 'Ältere &rsaquo;' ) ); ?>
</div>
</main>
<?php get_footer(); ?>