<?php get_header(); ?>
<?php get_template_part( 'template-parts/slider' ); ?>
<main class="site-main">
  <div class="container content-grid">
    <section class="content-area">
      <?php while ( have_posts() ) : the_post(); ?>
        <article id="post-<?php the_ID(); ?>" <?php post_class( 'page-content-card' ); ?>>
          <div class="page-content-card">
            <h1 class="entry-title"><?php the_title(); ?></h1>
            <div class="entry-content"><?php the_content(); ?></div>
          </div>
        </article>
      <?php endwhile; ?>

      <section class="post-list">
        <h2>Neueste Beiträge</h2>
        <?php
        $kgv_posts = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 5 ) );
        if ( $kgv_posts->have_posts() ) :
          while ( $kgv_posts->have_posts() ) : $kgv_posts->the_post();
            get_template_part( 'template-parts/content', get_post_type() );
          endwhile;
          wp_reset_postdata();
        endif;
        ?>
      </section>
    </section>
    <?php get_sidebar(); ?>
  </div>
</main>
<?php get_footer(); ?>
