Guest User

Untitled

a guest
May 27th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Event List.
  4. * The template for displaying all pages.
  5. *
  6. * This is the template that displays all pages by default.
  7. * Please note that this is the WordPress construct of pages
  8. * and that other 'pages' on your WordPress site will use a
  9. * different template.
  10. *
  11. * @package joerghalubek
  12. */
  13.  
  14. get_header('page'); ?>
  15.  
  16. <div id="primary" class="padding20px content-area">
  17. <main id="main" class="site-main" role="main">
  18. <div class="container">
  19. <div class="row">
  20. <div class="col-sm-12">
  21. <h2 class="section-headline-left">Vergangene Veranstaltungen</h2>
  22. </div>
  23. </div>
  24. <div class="row">
  25. <div class="col-sm-12 section-content">
  26. <div class="container overwrite-bs">
  27.  
  28. <?php
  29.  
  30. $yearcurrent = date('Y');
  31. $monthcurr = date('n');
  32.  
  33. for ($monthcurrent = $monthcurr ; $monthcurrent >= 1; $monthcurrent--) { ?>
  34.  
  35. <h3 class="title--month"><?
  36.  
  37. if ( $monthcurrent == "12" ) { echo "Dezember"; }
  38. elseif ( $monthcurrent == "11" ) { echo "November"; }
  39. elseif ( $monthcurrent == "10" ) { echo "Oktober"; }
  40. elseif ( $monthcurrent == "9" ) { echo "September"; }
  41. elseif ( $monthcurrent == "8" ) { echo "August"; }
  42. elseif ( $monthcurrent == "7" ) { echo "Juli"; }
  43. elseif ( $monthcurrent == "6" ) { echo "Juni"; }
  44. elseif ( $monthcurrent == "5" ) { echo "Mai"; }
  45. elseif ( $monthcurrent == "4" ) { echo "April"; }
  46. elseif ( $monthcurrent == "3" ) { echo "März"; }
  47. elseif ( $monthcurrent == "2" ) { echo "Februar"; }
  48. elseif ( $monthcurrent == "1" ) { echo "Januar"; }
  49.  
  50. } ?></h3><?
  51.  
  52. for ($year = $yearcurrent-1; $year >= 2009; $year--) {
  53.  
  54. $monthminus = 13;
  55.  
  56. for ($month = 12; $month >= 1; $month-- ) {
  57.  
  58. if ( $monthminus > 1 ) { $monthminus = $monthminus - 1; } else { $monthminus = 1; }
  59.  
  60. global $post;
  61.  
  62. echo $year;
  63. echo "-";
  64.  
  65. if ( $month == "12" ) { echo "Dezember"; }
  66. elseif ( $month == "11" ) { echo "November"; }
  67. elseif ( $month == "10" ) { echo "Oktober"; }
  68. elseif ( $month == "9" ) { echo "September"; }
  69. elseif ( $month == "8" ) { echo "August"; }
  70. elseif ( $month == "7" ) { echo "Juli"; }
  71. elseif ( $month == "6" ) { echo "Juni"; }
  72. elseif ( $month == "5" ) { echo "Mai"; }
  73. elseif ( $month == "4" ) { echo "April"; }
  74. elseif ( $month == "3" ) { echo "März"; }
  75. elseif ( $month == "2" ) { echo "Februar"; }
  76. elseif ( $month == "1" ) { echo "Januar"; }
  77.  
  78. $all_events = tribe_get_events(array(
  79. 'start_date' => $year.'-'.$month. '-01',
  80. 'end_date' => $year.'-'.$monthminus. '-01',
  81. 'posts_per_page'=> 999,
  82. 'orderby' => date,
  83. 'order' => DESC,
  84. 'eventDisplay' => past ));
  85.  
  86. foreach($all_events as $post) {
  87. setup_postdata($post); ?>
  88.  
  89. <div class="row event--single">
  90. <div class="col-xs-12 col-sm-3">
  91. <a href="<?php echo tribe_get_event_link(); ?>">
  92. <? echo tribe_get_start_date($post->ID, false, 'j. F Y'); ?>
  93. </a>
  94. </div>
  95. <div class="col-xs-12 col-sm-4">
  96. <a href="<?php echo tribe_get_event_link(); ?>">
  97. <?php echo sp_get_city(); ?> | <? echo sp_get_venue(); ?><br />
  98. </a>
  99. </div>
  100. <div class="col-xs-12 col-sm-5">
  101. <a href="<?php echo tribe_get_event_link(); ?>">
  102. <?php the_title(); ?>
  103. </a>
  104. </div>
  105. </div>
  106.  
  107. <?php }
  108. wp_reset_query();
  109. wp_reset_postdata();
  110. }
  111. }
  112. ?>
  113. </div>
  114. </div>
  115. </div>
  116. </main><!-- #main -->
  117. </div><!-- #primary -->
  118. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment