1
0

index.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php get_header();
  2. global $more; ?>
  3. <div class="posts-wrapper"><?php
  4. if(is_home()) {
  5. $args = array(
  6. 'category_name' => 'Startseite',
  7. 'meta_key' => 'order',
  8. 'orderby' => 'meta_value_num',
  9. 'order' => 'ASC'
  10. );
  11. $query = new WP_Query($args);
  12. if($query->have_posts()) {
  13. while($query->have_posts()) {
  14. $query->the_post();
  15. if(get_post_meta(get_the_ID(), 'ams_dual_columns_post', true) && !get_post_meta(get_the_ID(), 'ams_tda_gallery', true)) { // 2 Spalten
  16. $more = 1; // get whole content
  17. $content = get_the_content('', true);
  18. $more = 0; // reset to excerpt only
  19. $columnOne = substr($content, 0, strpos($content, '<!--column-->'));
  20. $columnTwo = substr($content, strpos($content, '<!--column-->'), strlen($content)); ?>
  21. <div id="post-<?php the_ID(); ?>" class="content-wrapper">
  22. <div class="beam">
  23. <div class="container">
  24. <div class="row">
  25. <div class="col-md-12">
  26. <h1><?php the_title(); ?></h1>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="container text-muted">
  32. <div class="row">
  33. <div class="col-md-6">
  34. <span class="teaser"><?php the_excerpt(); ?></span>
  35. <?= $columnOne; ?><br>
  36. </div>
  37. <div class="col-md-6">
  38. <?= $columnTwo; ?>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="container b-to-top">
  43. <div class="row">
  44. <div class="col-xs-12">
  45. <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
  46. </div>
  47. </div>
  48. </div>
  49. </div><?php
  50. } 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
  51. $more = 1; // get whole content
  52. $content = get_the_content('', true);
  53. $more = 0; // reset to excerpt only
  54. $columnOne = substr($content, 0, strpos($content, '<!--column-->'));
  55. $columnTwo = substr($content, strpos($content, '<!--column-->'), strlen($content)); ?>
  56. <div id="post-<?php the_ID(); ?>" class="content-wrapper">
  57. <div class="beam">
  58. <div class="container">
  59. <div class="row">
  60. <div class="col-md-12">
  61. <h1><?php the_title(); ?></h1>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="container text-muted">
  67. <div class="row">
  68. <div class="col-md-6">
  69. <span class="teaser"><?php the_excerpt(); ?></span>
  70. <?= $columnOne; ?><br>
  71. </div>
  72. <div class="col-md-6">
  73. <?= $columnTwo; ?>
  74. </div><?php
  75. // images (gallery)
  76. $tdaQuery = new WP_Query(array('post_type' => 'tdas'));
  77. if($tdaQuery->have_posts()) { ?>
  78. <div class="col-md-12 tda-gallery claerfix">
  79. <div class="row"><?php
  80. while($tdaQuery->have_posts()) {
  81. $tdaQuery->the_post(); ?>
  82. <div class="col-md-3 col-xs-6 tda-item" style="padding-bottom: 15px;">
  83. <div class="relcontainer">
  84. <a href="<?= get_permalink(); ?>">
  85. <?php if(has_post_thumbnail()) the_post_thumbnail('thumbnail', array('class' => 'tda-gallery-item')); ?>
  86. <div class="tda-hover">
  87. <div class="relcontainer">
  88. <span><?php the_title(); ?></span>
  89. </div>
  90. </div>
  91. </a>
  92. </div>
  93. </div><?php
  94. } ?>
  95. </div>
  96. </div><?php
  97. }
  98. /*// content-containers
  99. $tdaQuery = new WP_Query(array('post_type' => 'tdas'));
  100. $count = 0;
  101. if($tdaQuery->have_posts()) {
  102. while($tdaQuery->have_posts()) {
  103. $tdaQuery->the_post(); ?>
  104. <div id="tda-content-<?= $count; ?>" class="col-md-4 tda-content" style="text-align: center; display: none;">
  105. <h1><a href="<?= get_permalink(); ?>"><?php the_title(); ?></a></h1>
  106. <p><?= substr(get_the_excerpt(), 0, strpos(get_the_excerpt(), ' ', 225)) . " ..."; ?></p>
  107. </div><?php
  108. $count++;
  109. }
  110. }*/ ?>
  111. </div>
  112. </div>
  113. <div class="container b-to-top">
  114. <div class="row">
  115. <div class="col-xs-12">
  116. <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
  117. </div>
  118. </div>
  119. </div>
  120. </div><?php
  121. } else if(get_post_meta(get_the_ID(), 'ams_tda_gallery', true)) { // TdA Galerie
  122. } else if(get_post_meta(get_the_ID(), 'ams_partners', true)) { // Partner
  123. $partnerQuery = new WP_Query( array( 'post_type' => 'partners', 'orderby' => 'title', 'order' => 'ASC' ) );
  124. if($partnerQuery->have_posts()) { ?>
  125. <div id="post-<?php the_ID(); ?>" class="content-wrapper">
  126. <div class="beam">
  127. <div class="container">
  128. <div class="row">
  129. <div class="col-md-12">
  130. <h1><?php the_title(); ?></h1>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <div id="partners" class="container text-muted">
  136. <div class="row"><?php
  137. while($partnerQuery->have_posts()) {
  138. $partnerQuery->the_post(); ?>
  139. <div class="col-md-4">
  140. <div class="card">
  141. <?php if(has_post_thumbnail()) the_post_thumbnail('thumbnail', array('class' => 'card-img-top')); ?>
  142. <div class="card-block">
  143. <h4 class="card-title"><?= get_the_title(); ?></h4>
  144. <p class="card-text">
  145. <?php echo the_content(); ?>
  146. </p>
  147. </div>
  148. </div>
  149. </div><?php
  150. } ?>
  151. </div>
  152. </div>
  153. <div class="container b-to-top">
  154. <div class="row">
  155. <div class="col-xs-12">
  156. <a href="#top" class="scroll-link"><i class="fa fa-chevron-up" aria-hidden="true"></i></a>
  157. </div>
  158. </div>
  159. </div>
  160. </div><?php
  161. wp_reset_postdata();
  162. }
  163. } else {
  164. the_title();
  165. the_excerpt();
  166. }
  167. }
  168. } else {
  169. echo "ayy no post lmalala"; // TODO: this
  170. }
  171. } else {
  172. the_title();
  173. } ?>
  174. </div><?php
  175. get_footer(); ?>