Advertisement
Guest User

mmc

a guest
Jan 8th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <?php
  2.  
  3. // event posts settings
  4.  
  5. global $post;
  6.  
  7. $i = 1;
  8.  
  9. $currentdate = date('Y-m-d');
  10.  
  11. $eventsloop = new WP_Query( array(
  12.  
  13. 'post_type' => 'makemycalendar',
  14. 'orderby' => 'meta_value',
  15. 'meta_key' => 'makemycalendar_startdate',
  16. 'order' => 'ASC',
  17. 'event-categories' => $category,
  18. 'posts_per_page' => 9999
  19.  
  20. ) );
  21.  
  22. global $wp_query;
  23. $eventsloop->in_the_loop = true;
  24.  
  25. // event posts loop
  26.  
  27. while ( $eventsloop->have_posts() ) : $eventsloop->the_post();
  28.  
  29. $startdate = get_post_meta( $post->ID, "makemycalendar_startdate", $single = true );
  30.  
  31. $startstring = strtotime($startdate);
  32.  
  33. $starttext = date('M j, Y', $startstring);
  34.  
  35. if ( $startdate >= $currentdate && $i <= $quantity ) { ?>
  36.  
  37. <div <?php post_class(); ?>>
  38.  
  39. <div class="mmc-event-thumbnail">
  40.  
  41. <?php if ( has_post_thumbnail() ): ?>
  42.  
  43. <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?></a>
  44.  
  45. <?php endif; ?>
  46.  
  47. </div><!-- .mmc-event-thumbnail -->
  48.  
  49. <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
  50.  
  51. <em><?php echo $starttext; ?></em>
  52.  
  53. <?php the_excerpt(); ?>
  54.  
  55. <div class="clear"></div>
  56.  
  57. </div><!-- .post -->
  58.  
  59. <?php $i++; ?>
  60.  
  61. <?php } //end startdate and quantity conditional ?>
  62.  
  63. <?php endwhile; ?>
  64.  
  65. <?php wp_reset_postdata(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement