Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: None  |  size: 2.83 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php get_header(); ?>
  2.  
  3. <?php
  4. $loop = new wp_query(
  5.                                 array( 'post_type' => 'event', 'meta_id' => '538', 'meta_key' => '_event_start', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => '30') ); ?>
  6.  
  7. <?php
  8. $nmtab = date("m"+1);
  9. $tnextmonth = date("F",strtotime("+1 months"));
  10. $tmonthafter = date("F",strtotime("+2 months"));
  11. ?>
  12.  
  13. <?php if ( $loop->have_posts() ) while ( $loop->have_posts() ) : $loop->the_post();
  14. $currentdate = date("Ymd");
  15. $expirationdate = get_post_custom_values('_event_start');
  16.         if (is_null($expirationdate)) {
  17.         $expirestring = '30005050'; //MAKE UN-EXPIRING POSTS ALWAYS SHOW UP;
  18.         } else {
  19.  
  20.         if (is_array($expirationdate)) {
  21.         $expirestringarray = implode($expirationdate);
  22.         }
  23.         $expirestring = str_replace("/","",$expirestringarray);
  24.         } //else
  25.         if ( $expirestring > $currentdate ) {
  26.        
  27.         $currmonth = date("m");
  28.         $nextmonth = ($currmonth+1);
  29.         $monthafter = ($currmonth+2);
  30.         $strdate = (get_post_meta($post->ID, '_event_start', true));
  31.         $str = date("m",strtotime($strdate));
  32.         $pattern = "/(.{1,2})/";       
  33.         preg_match($pattern, $str, $month);
  34.         if ($month[0] == $monthafter) {
  35. ?>
  36.  
  37. <?php the_title(); ?>  <!-- first part of loop -->
  38.  
  39. <?php }?>
  40. <?php } ?>
  41.  
  42. <?php rewind_posts(); ?>
  43.  
  44. </div>
  45.  
  46.  
  47. <?php if ( $loop->have_posts() ) while ( $loop->have_posts() ) : $loop->the_post();
  48.         $currentdate = date("Ymd");
  49.         $expirationdate = get_post_custom_values('_event_start');
  50.         if (is_null($expirationdate)) {
  51.         $expirestring = '30005050'; //MAKE UN-EXPIRING POSTS ALWAYS SHOW UP;
  52.         } else {
  53.  
  54.         if (is_array($expirationdate)) {
  55.         $expirestringarray = implode($expirationdate);
  56.         }
  57.         $expirestring = str_replace("/","",$expirestringarray);
  58.         } //else
  59.         if ( $expirestring > $currentdate ) {
  60.        
  61.         $currmonth = date("m");
  62.         $nextmonth = ($currmonth+1);
  63.         $monthafter = ($currmonth+2);
  64.         $strdate = (get_post_meta($post->ID, '_event_start', true));
  65.         $str = date("m",strtotime($strdate));
  66.         $pattern = "/(.{1,2})/";       
  67.         preg_match($pattern, $str, $month);
  68.         if ($month[0] == $monthafter) {
  69. ?>
  70.         <div id="events-container">
  71.                 <div class="events-date">
  72.                
  73.                         <?php
  74.                         $getdate = (get_post_meta($post->ID, '_event_start', true));
  75.                         $eventdate = date("l, jS F",strtotime($getdate));
  76.                         echo $eventdate                        
  77.                         ?>     
  78.                 </div>
  79.                 <div id="events-box">          
  80.                                 <div class="events-img"><?php the_post_thumbnail(); ?>
  81.                                        
  82.                                 </div> 
  83.                 </div>         
  84.                                                
  85.                 <div id="events-detail">                                       
  86.                         <div class="events-content">
  87.                                         <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
  88.                                 <h1 class="events-title">
  89.  
  90.                                         <?php the_title(); ?>
  91.                                        
  92.                                         </h1>  
  93.                                 <div class="events-content"><?php the_content(); ?></div>
  94.                        
  95.  
  96. <?php } ?>
  97. <?php } ?>
  98.  
  99. <?php endwhile; ?>     
  100. <br>   
  101. </div>
  102. <?php include 'sidebar_two_column.php';?>
  103.                 </div><!-- #container -->
  104.  
  105.  
  106. <?php get_footer(); ?>