Advertisement
BakerMan

Event Category Switch: ecp-page-template.php

Aug 23rd, 2012
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1. <?php
  2. /**
  3. *  If 'Default Events Template' is selected in Settings -> The Events Calendar -> Theme Settings -> Events Template,
  4. *  then this file loads the page template for all ECP views except for the individual
  5. *  event view.  Generally, this setting should only be used if you want to manually
  6. *  specify all the shell HTML of your ECP pages in this template file.  Use one of the other Theme
  7. *  Settings -> Events Template to automatically integrate views into your
  8. *  theme.
  9. *
  10. */
  11.  
  12. // Don't load directly
  13. if ( !defined('ABSPATH') ) { die('-1'); }
  14.  
  15. /**
  16.  * Use different templates for specific category requests.
  17.  */
  18. switch (tribe_meta_event_category_name()) {
  19.     case 'Event Category 1':
  20.         get_template_part('special-tpl-1');
  21.         return;
  22.     break;
  23.    
  24.     case 'Event Category 2':
  25.         get_template_part('special-tpl-2');
  26.         return;
  27.     break;
  28. }
  29.  
  30. ?> 
  31. <?php get_header(); ?>
  32. <?php tribe_events_before_html() ?>
  33. <h2 class="tribe-events-cal-title"><?php tribe_events_title(); ?></h2>
  34. <?php include(tribe_get_current_template()); ?>
  35. <?php tribe_events_after_html() ?>
  36. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement