eventsmanager

Events List Group by Category

Sep 25th, 2013
1,652
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. this snippet will create a new shortcode [category_events_list_group]
  3.  
  4. Sample output:
  5.  
  6. Music
  7.  
  8. Sept 2013
  9.  
  10. Jazz Only Night - 2013/10/15 - 2013/10/16
  11. Rock n Roll 70's - 2013/10/18 - 2013/10/18
  12.  
  13. */
  14. function em_events_list_by_category(){
  15.  
  16. $EM_Categories = EM_Categories::get( array( 'exclude' => array(1,2,3) ) );
  17.  
  18. foreach( $EM_Categories as $EM_Category ){
  19.  
  20. echo "<h2>".$EM_Category->name."</h2>";
  21. echo do_shortcode('[events_list_grouped mode="monthly" category="'.$EM_Category->term_id.'"]');
  22.  
  23. }
  24.  
  25. }
  26. add_shortcode('category_events_list_group', 'em_events_list_by_category');
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.

×