eventsmanager

custom events list

Jul 27th, 2013
674
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * Paste in your theme functions.php
  3. */
  4. function em_mod_custom_events_list(){
  5. $events = EM_Events::get(array('scope'=>'future','limit'=>10));
  6. ?>
  7. <table>
  8. <tbody>
  9. <?php
  10. $start = false;
  11. $limit = 3;
  12. $count = 1;
  13. foreach( $events as $EM_Event ){
  14. if ( !empty($EM_Event->event_name) ){
  15. ?>
  16. <?php if ( !$start ) { ?>
  17. <tr>
  18. <?php $start = true; ?>
  19. <?php } ?>
  20. <td><?php echo $EM_Event->output("#_EVENTLINK"); ?></td>
  21. <?php
  22. if ( $count == $limit ){
  23. ?>
  24. </tr>
  25. <?php
  26. $start = false;
  27. $count = 1;
  28. }else{
  29. $count++;
  30. }
  31. ?>
  32. <?php
  33. }
  34. }
  35. ?>
  36. </tbody>
  37. </table>
  38. <?php
  39.  
  40. }
  41. add_shortcode('custom_events_list', 'em_mod_custom_events_list');
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×