Advertisement
BakerMan

Adapted gridview (TEC 2.0.11) - list of terms

Apr 4th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.41 KB | None | 0 0
  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 '<ul class="events-cat-menu">';
  14.     foreach ( $terms as $term ) {
  15.         echo '<li class="cat_'. $term->slug .'"><a href="'. get_term_link($term->slug, 'tribe_events_cat') .'">' . $term->name . '</a></li>';
  16.     }
  17.     echo '</ul>';
  18. }
  19. ?> 
  20.     <div id="tribe-events-content" class="grid" data-title="<?php wp_title(); ?>">
  21.         <div id='tribe-events-calendar-header' class="clearfix">
  22.             <span class='tribe-events-month-nav'>
  23.                 <span class='tribe-events-prev-month'>
  24.                     <a href='<?php echo tribe_get_previous_month_link(); ?>' class="tribe-pjax">
  25.                     &#x2190; <?php echo tribe_get_previous_month_text(); ?>
  26.                     </a>
  27.                 </span>
  28.  
  29.                 <?php tribe_month_year_dropdowns( "tribe-events-" ); ?>
  30.  
  31.                 <span class='tribe-events-next-month'>
  32.                     <a href='<?php echo tribe_get_next_month_link(); ?>' class="tribe-pjax">
  33.                     <?php echo tribe_get_next_month_text(); ?> &#x2192;
  34.                     </a>
  35.                <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" style='display: none'/>
  36.                 </span>
  37.             </span>
  38.  
  39.             <span class='tribe-events-calendar-buttons'>
  40.                 <a class='tribe-events-button-off' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar'); ?></a>
  41.                 <a class='tribe-events-button-on' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar'); ?></a>
  42.             </span>
  43.         </div><!-- tribe-events-calendar-header -->
  44.         <?php tribe_calendar_grid(); // See the views/table.php template for customization ?>
  45.       <?php if( function_exists( 'tribe_get_ical_link' ) ): ?>
  46.          <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>
  47.       <?php endif; ?>
  48.         <?php if (tribe_get_option('donate-link', false) == true) { ?>
  49.             <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>
  50.         <?php } ?>
  51.     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement