Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Event List.
- * The template for displaying all pages.
- *
- * This is the template that displays all pages by default.
- * Please note that this is the WordPress construct of pages
- * and that other 'pages' on your WordPress site will use a
- * different template.
- *
- * @package joerghalubek
- */
- get_header('page'); ?>
- <div id="primary" class="padding20px content-area">
- <main id="main" class="site-main" role="main">
- <div class="container">
- <div class="row">
- <div class="col-sm-12">
- <h2 class="section-headline-left">Vergangene Veranstaltungen</h2>
- </div>
- </div>
- <div class="row">
- <div class="col-sm-12 section-content">
- <div class="container overwrite-bs">
- <?php
- $yearcurrent = date('Y');
- $monthcurr = date('n');
- for ($monthcurrent = $monthcurr ; $monthcurrent >= 1; $monthcurrent--) {
- ?><h3 class="title--month">
- if ( $monthcurrent == "12" ) { echo "Dezember"; }
- elseif ( $monthcurrent == "11" ) { echo "November"; }
- elseif ( $monthcurrent == "10" ) { echo "Oktober"; }
- elseif ( $monthcurrent == "9" ) { echo "September"; }
- elseif ( $monthcurrent == "8" ) { echo "August"; }
- elseif ( $monthcurrent == "7" ) { echo "Juli"; }
- elseif ( $monthcurrent == "6" ) { echo "Juni"; }
- elseif ( $monthcurrent == "5" ) { echo "Mai"; }
- elseif ( $monthcurrent == "4" ) { echo "April"; }
- elseif ( $monthcurrent == "3" ) { echo "März"; }
- elseif ( $monthcurrent == "2" ) { echo "Februar"; }
- elseif ( $monthcurrent == "1" ) { echo "Januar"; }
- } ?></h3><?
- for ($year = $yearcurrent-1; $year >= 2009; $year--) {
- $monthminus = 13;
- for ($month = 12; $month >= 1; $month-- ) {
- if ( $monthminus > 1 ) { $monthminus = $monthminus - 1; } else { $monthminus = 1; }
- global $post;
- echo $year;
- echo "-";
- if ( $month == "12" ) { echo "Dezember"; }
- elseif ( $month == "11" ) { echo "November"; }
- elseif ( $month == "10" ) { echo "Oktober"; }
- elseif ( $month == "9" ) { echo "September"; }
- elseif ( $month == "8" ) { echo "August"; }
- elseif ( $month == "7" ) { echo "Juli"; }
- elseif ( $month == "6" ) { echo "Juni"; }
- elseif ( $month == "5" ) { echo "Mai"; }
- elseif ( $month == "4" ) { echo "April"; }
- elseif ( $month == "3" ) { echo "März"; }
- elseif ( $month == "2" ) { echo "Februar"; }
- elseif ( $month == "1" ) { echo "Januar"; }
- $all_events = tribe_get_events(array(
- 'start_date' => $year.'-'.$month. '-01',
- 'end_date' => $year.'-'.$monthminus. '-01',
- 'posts_per_page'=> -1,
- 'orderby' => date,
- 'order' => DESC,
- 'eventDisplay' => PAST
- ));
- foreach($all_events as $post) {
- setup_postdata($post); ?>
- <div class="row event--single">
- <div class="col-xs-12 col-sm-3">
- <a href="<?php echo tribe_get_event_link(); ?>">
- <? echo tribe_get_start_date($post->ID, false, 'j. F Y'); ?>
- </a>
- </div>
- <div class="col-xs-12 col-sm-4">
- <a href="<?php echo tribe_get_event_link(); ?>">
- <?php echo sp_get_city(); ?> | <? echo sp_get_venue(); ?><br />
- </a>
- </div>
- <div class="col-xs-12 col-sm-5">
- <a href="<?php echo tribe_get_event_link(); ?>">
- <?php the_title(); ?>
- </a>
- </div>
- </div>
- <?php }
- wp_reset_query();
- wp_reset_postdata();
- }
- }
- ?>
- </div>
- </div>
- </div>
- </main><!-- #main -->
- </div><!-- #primary -->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment