This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

YARPP - Events Manager

By: ksaffy on Jun 15th, 2013  |  syntax: None  |  size: 1.26 KB  |  views: 41  |  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
  2. /*
  3. YARPP Template: Thumbnails
  4. Description: Requires a theme which supports post thumbnails
  5. */ ?>
  6. <?php
  7. global $post;
  8. $EM_Event = em_get_event($post->ID, 'post_id');
  9. ?>
  10. <?php if (have_posts()):?>
  11. <h3 class="sub">Other Events you May Like</h3>
  12.         <?php while (have_posts()) : the_post();
  13. $EM_Event = em_get_event($post->ID, 'post_id');
  14. $eventdate =  date('Y-m-d', $EM_Event->start);
  15. $today = date('Y-m-d',current_time('timestamp')); ?>
  16. <?php if ($eventdate >= $today): ?>
  17. <?if ( has_post_thumbnail() ):?>
  18.      <ul id='related_posts_thumbnails'>
  19.        <li>
  20.         <?php $d = date_i18n(get_option('dbem_date_format'), $EM_Event->start); ?><?php $t = date_i18n(get_option('time_format'), $EM_Event->start) ; ?>
  21. <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('270x150'); ?><span><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title_attribute(); ?><br />
  22. <p class="left"><?php echo  $d ; ?></p><p class="right"><?php echo  $t ; ?>&nbsp;&nbsp;</p>
  23.   </a></a></span></li>         
  24.        </ul>
  25. <?php endif; ?>
  26. <?php endif; ?>
  27. <?php endwhile; ?>
  28. <?php else: ?>
  29. <h3 class="sub">Other Events you May Like</h3>
  30. <p>No similar events...</p>
  31. <?php endif; ?>
clone this paste RAW Paste Data