    <?php get_header();

    global $more; ?>

    <div class="posts-wrapper"><?php

    if(is_home()) {
      $args = array(
        'category_name' => 'Startseite',
        'meta_key'      => 'order',
        'orderby'       => 'meta_value_num',
        'order'         => 'ASC'
      );
      $query = new WP_Query($args);
      if($query->have_posts()) {
        while($query->have_posts()) {
          $query->the_post();

          if(get_post_meta(get_the_ID(), 'ams_dual_columns_post', true) && !get_post_meta(get_the_ID(), 'ams_tda_gallery', true) && !get_post_meta(get_the_ID(), 'ams_projects', true)) { // 2 Spalten

            $more = 1; // get whole content
            $content = get_the_content('', true);
            $more = 0; // reset to excerpt only

            $columnOne = substr($content, 0, strpos($content, '<!--column-->'));
            $columnTwo = substr($content, strpos($content, '<!--column-->'), strlen($content)); ?>

            <div id="post-<?php the_ID(); ?>" class="content-wrapper">
              <div class="relcontainer">
                <div id="post-<?php the_ID(); ?>-jumper" class="jumper"></div>
              </div>
              <div class="beam">
                <div class="container">
                  <div class="row">
                    <div class="col-md-12">
                      <h1><?php the_title(); ?></h1>
                    </div>
                  </div>
                </div>
              </div>
              <div class="container text-muted">
                <div class="row">
                  <div class="col-md-6">
                    <span class="teaser"><?php the_excerpt(); ?></span>
                    <?= $columnOne; ?><br>
                  </div>
                  <div class="col-md-6">
                    <?= $columnTwo; ?>
                  </div>
                </div>
              </div>
              <div class="container b-to-top">
                <div class="row">
                  <div class="col-xs-12">
                    <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
                  </div>
                </div>
              </div>
            </div><?php

          } else if(get_post_meta(get_the_ID(), 'ams_dual_columns_post', true) && get_post_meta(get_the_ID(), 'ams_tda_gallery', true)) { // 2 Spalten & TdA Galerie

            $more = 1; // get whole content
            $content = get_the_content('', true);
            $more = 0; // reset to excerpt only

            $columnOne = substr($content, 0, strpos($content, '<!--column-->'));
            $columnTwo = substr($content, strpos($content, '<!--column-->'), strlen($content)); ?>

            <div id="post-<?php the_ID(); ?>" class="content-wrapper">
              <div class="relcontainer">
                <div id="post-<?php the_ID(); ?>-jumper" class="jumper"></div>
              </div>
              <div class="beam">
                <div class="container">
                  <div class="row">
                    <div class="col-md-12">
                      <h1><?php the_title(); ?></h1>
                    </div>
                  </div>
                </div>
              </div>
              <div class="container text-muted">
                <div class="row">
                  <div class="col-md-6">
                    <span class="teaser"><?php the_excerpt(); ?></span>
                    <?= strip_shortcodes($columnOne); ?><br>
                  </div>
                  <div class="col-md-6">
                    <?= strip_shortcodes($columnTwo); ?>
                  </div>
                  <?php echo do_shortcode("[hoverboxes type=\"tdas\"]"); ?>
                </div>
              </div>
              <div class="container b-to-top">
                <div class="row">
                  <div class="col-xs-12">
                    <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
                  </div>
                </div>
              </div>
            </div><?php

          } else if(get_post_meta(get_the_ID(), 'ams_tda_gallery', true)) { // TdA Galerie

          } else if(get_post_meta(get_the_ID(), 'ams_partners', true)) { // Partner

            $partnerQuery = new WP_Query( array( 'post_type' => 'partners', 'order' => 'ASC' ) );
            if($partnerQuery->have_posts()) { ?>
              <div id="post-<?php the_ID(); ?>" class="content-wrapper">
                <div class="relcontainer">
                  <div id="post-<?php the_ID(); ?>-jumper" class="jumper"></div>
                </div>
                <div class="beam">
                  <div class="container">
                    <div class="row">
                      <div class="col-md-12">
                        <h1><?php the_title(); ?></h1>
                      </div>
                    </div>
                  </div>
                </div>
                <?php echo do_shortcode("[partnersboxes]"); ?>
                <div class="container b-to-top">
                  <div class="row">
                    <div class="col-xs-12">
                      <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
                    </div>
                  </div>
                </div>
              </div><?php
              wp_reset_postdata();
            }
          } else if(get_post_meta(get_the_ID(), 'ams_dual_columns_post', true) && get_post_meta(get_the_ID(), 'ams_projects', true)) { // 2 Spalten & Projekte

            $more = 1; // get whole content
            $content = get_the_content('', true);
            $more = 0; // reset to excerpt only

            $columnOne = substr($content, 0, strpos($content, '<!--column-->'));
            $columnTwo = substr($content, strpos($content, '<!--column-->'), strlen($content)); ?>

            <div id="post-<?php the_ID(); ?>" class="content-wrapper">
              <div class="relcontainer">
                <div id="post-<?php the_ID(); ?>-jumper" class="jumper"></div>
              </div>
              <div class="beam">
                <div class="container">
                  <div class="row">
                    <div class="col-md-12">
                      <h1><?php the_title(); ?></h1>
                    </div>
                  </div>
                </div>
              </div>
              <div class="container text-muted">
                <div class="row">
                  <div class="col-md-6">
                    <span class="teaser"><?php the_excerpt(); ?></span>
                    <?= strip_shortcodes($columnOne); ?><br>
                  </div>
                  <div class="col-md-6">
                    <?= strip_shortcodes($columnTwo); ?>
                  </div>
                  <?php echo do_shortcode("[hoverboxes type=\"projects\"]"); ?>
                </div>
              </div>
              <div class="container b-to-top">
                <div class="row">
                  <div class="col-xs-12">
                    <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
                  </div>
                </div>
              </div>
            </div><?php

          } else {
            the_title();
            the_excerpt();
          }
        }
      } else {
        echo "404"; // TODO: this
      }
    } else {
      error_log("YOOO");
    } ?>

    </div><?php

    get_footer(); ?>