- <?php get_header(); ?>
- <?php
- $loop = new wp_query(
- array( 'post_type' => 'event', 'meta_id' => '538', 'meta_key' => '_event_start', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => '30') ); ?>
- <?php
- $nmtab = date("m"+1);
- $tnextmonth = date("F",strtotime("+1 months"));
- $tmonthafter = date("F",strtotime("+2 months"));
- ?>
- <?php if ( $loop->have_posts() ) while ( $loop->have_posts() ) : $loop->the_post();
- $currentdate = date("Ymd");
- $expirationdate = get_post_custom_values('_event_start');
- if (is_null($expirationdate)) {
- $expirestring = '30005050'; //MAKE UN-EXPIRING POSTS ALWAYS SHOW UP;
- } else {
- if (is_array($expirationdate)) {
- $expirestringarray = implode($expirationdate);
- }
- $expirestring = str_replace("/","",$expirestringarray);
- } //else
- if ( $expirestring > $currentdate ) {
- $currmonth = date("m");
- $nextmonth = ($currmonth+1);
- $monthafter = ($currmonth+2);
- $strdate = (get_post_meta($post->ID, '_event_start', true));
- $str = date("m",strtotime($strdate));
- $pattern = "/(.{1,2})/";
- preg_match($pattern, $str, $month);
- if ($month[0] == $monthafter) {
- ?>
- <?php the_title(); ?> <!-- first part of loop -->
- <?php }?>
- <?php } ?>
- <?php rewind_posts(); ?>
- </div>
- <?php if ( $loop->have_posts() ) while ( $loop->have_posts() ) : $loop->the_post();
- $currentdate = date("Ymd");
- $expirationdate = get_post_custom_values('_event_start');
- if (is_null($expirationdate)) {
- $expirestring = '30005050'; //MAKE UN-EXPIRING POSTS ALWAYS SHOW UP;
- } else {
- if (is_array($expirationdate)) {
- $expirestringarray = implode($expirationdate);
- }
- $expirestring = str_replace("/","",$expirestringarray);
- } //else
- if ( $expirestring > $currentdate ) {
- $currmonth = date("m");
- $nextmonth = ($currmonth+1);
- $monthafter = ($currmonth+2);
- $strdate = (get_post_meta($post->ID, '_event_start', true));
- $str = date("m",strtotime($strdate));
- $pattern = "/(.{1,2})/";
- preg_match($pattern, $str, $month);
- if ($month[0] == $monthafter) {
- ?>
- <div id="events-container">
- <div class="events-date">
- <?php
- $getdate = (get_post_meta($post->ID, '_event_start', true));
- $eventdate = date("l, jS F",strtotime($getdate));
- echo $eventdate
- ?>
- </div>
- <div id="events-box">
- <div class="events-img"><?php the_post_thumbnail(); ?>
- </div>
- </div>
- <div id="events-detail">
- <div class="events-content">
- <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
- <h1 class="events-title">
- <?php the_title(); ?>
- </h1>
- <div class="events-content"><?php the_content(); ?></div>
- <?php } ?>
- <?php } ?>
- <?php endwhile; ?>
- <br>
- </div>
- <?php include 'sidebar_two_column.php';?>
- </div><!-- #container -->
- <?php get_footer(); ?>