Advertisement
FriendlyWP

Events Cal Pro category display

Jun 30th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.34 KB | None | 0 0
  1. // DISPLAY EVENTS
  2. function mm_display_seminars() {
  3.     global $wp_query, $sp_ecp;
  4.     $old_display = $wp_query->get('eventDisplay');
  5.     $wp_query->set('eventDisplay', 'upcoming');
  6.     $event_options = array(
  7.         'numResults' => 3,
  8.         'eventCat' => 'seminars',
  9.     );
  10.     $event = sp_get_events( $event_options );
  11.     ?>
  12.     <div class="feature-cat feature-seminars">
  13.     <h3><a href="">Seminars</a></h3>
  14.         <ul>
  15.     <?php
  16.         foreach($event as $e){
  17.         $event_month = date('M',strtotime($e->EventStartDate)); //Format the month
  18.         $event_day = date('j',strtotime($e->EventStartDate)); //Format the day
  19.         //$e->EventStartDate= date('F j, Y',strtotime($e->EventStartDate));
  20.         if (strtotime($e->EventStartDate) != strtotime($e->EventEndDate)) {
  21.     ?>
  22.       <li><div class="date">
  23.       <div class="date-inner">
  24.       <span class="month"><?php echo $event_month; ?></span>
  25.       <span class="day"><?php echo $event_day; ?></span>
  26.       </div></div>
  27.       <div class="txt">
  28.         <p><a class="read-more-title-link" href="<?php echo home_url(); ?>/event/<?php echo $e->post_name; ?>"><?php echo $e->post_title; ?></a></p>
  29.       </div></li>
  30.       <?php }
  31.         }
  32.     ?>
  33.     </ul><a class="lnk-more" href="<?php echo get_bloginfo('url'); ?>/calendar/category/seminars/upcoming">more</a>
  34. </div>
  35. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement