Advertisement
BakerMan

Adapted gridview (TEC 2.0.11) - list of terms (2)

Apr 4th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * Grid view template with a list of terms at the top (per Jonah Coyote's snippet)
  4.  */
  5.  
  6. // Don't load directly
  7. if ( !defined('ABSPATH') ) { die('-1'); }
  8. $tribe_ecp = TribeEvents::instance();
  9.  
  10. $terms = get_terms("tribe_events_cat");
  11. $count = count($terms);
  12. if ( $count > 0 ){
  13.     echo '<label for="lori-category-filter">Show me events for</label>';
  14.     echo '<select id="lori-category-filter">';
  15.     foreach ( $terms as $term ) {
  16.         echo '<option value="'.get_term_link($term->slug, 'tribe_events_cat').'">'.$term->name.'</option>';
  17.     }
  18.     echo '</select>';
  19.     echo '<button name="do-lori-filters">Show me!</button>';
  20. }
  21. ?> 
  22.     <div id="tribe-events-content" class="grid" data-title="<?php wp_title(); ?>">
  23.         <div id='tribe-events-calendar-header' class="clearfix">
  24.             <span class='tribe-events-month-nav'>
  25.                 <span class='tribe-events-prev-month'>
  26.                     <a href='<?php echo tribe_get_previous_month_link(); ?>' class="tribe-pjax">
  27.                     &#x2190; <?php echo tribe_get_previous_month_text(); ?>
  28.                     </a>
  29.                 </span>
  30.  
  31.                 <?php tribe_month_year_dropdowns( "tribe-events-" ); ?>
  32.  
  33.                 <span class='tribe-events-next-month'>
  34.                     <a href='<?php echo tribe_get_next_month_link(); ?>' class="tribe-pjax">
  35.                     <?php echo tribe_get_next_month_text(); ?> &#x2192;
  36.                     </a>
  37.                <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" style='display: none'/>
  38.                 </span>
  39.             </span>
  40.  
  41.             <span class='tribe-events-calendar-buttons'>
  42.                 <a class='tribe-events-button-off' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar'); ?></a>
  43.                 <a class='tribe-events-button-on' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar'); ?></a>
  44.             </span>
  45.         </div><!-- tribe-events-calendar-header -->
  46.         <?php tribe_calendar_grid(); // See the views/table.php template for customization ?>
  47.       <?php if( function_exists( 'tribe_get_ical_link' ) ): ?>
  48.          <a title="<?php esc_attr_e('iCal Import', 'tribe-events-calendar'); ?>" class="ical" href="<?php echo tribe_get_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar'); ?></a>
  49.       <?php endif; ?>
  50.         <?php if (tribe_get_option('donate-link', false) == true) { ?>
  51.             <p class="tribe-promo-banner"><?php echo apply_filters('tribe_promo_banner', sprintf( __('Calendar powered by %sThe Events Calendar%s', 'tribe-events-calendar'), '<a href="http://tri.be/wordpress-events-calendar/">', '</a>' ) ); ?></p>
  52.         <?php } ?>
  53.     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement