Advertisement
Guest User

TSC ecp-page-template

a guest
Jan 3rd, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 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. * You can customize this view by putting a replacement file of the same name (ecp-page-template.php) in the events/ directory of your theme.
  11. */
  12.  
  13. // Don't load directly
  14. if ( !defined('ABSPATH') ) { die('-1'); }
  15.  
  16.  
  17. // Don't allow anything earlier than this month to be displayed in the gridview
  18. if (isset($eventDate) and isset($eventDisplay) and $eventDisplay === 'month') {
  19. $thisMonth = '2012-10-01';
  20. $redirectTo = get_site_url();
  21.  
  22. // Is the user requesting something earlier than this month?
  23. if ($eventDate < $thisMonth) {
  24. // Redirect if possible
  25. if (!headers_sent()) {
  26. header("Location: $redirectTo");
  27. exit();
  28. }
  29. // If not possible to redirect, show an error message or 404
  30. else {
  31. get_template_part('404');
  32. }
  33. }
  34. }
  35.  
  36. ?>
  37. <?php get_header(); ?>
  38. <?php tribe_events_before_html(); ?>
  39. <h2 class="tribe-events-cal-title"><?php tribe_events_title(); ?></h2>
  40. <?php include(tribe_get_current_template()); ?>
  41. <?php tribe_events_after_html(); ?>
  42. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement