Advertisement
ironandsteel

list-widget.php

Oct 30th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.78 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Events Pro List Widget Template
  4.  * This is the template for the output of the events list widget.
  5.  * All the items are turned on and off through the widget admin.
  6.  * There is currently no default styling, which is highly needed.
  7.  *
  8.  * Override this template in your own theme by creating a file at [your-theme]/tribe-events/widgets/list-widget.php
  9.  *
  10.  * When the template is loaded, the following vars are set: $start, $end, $venue,
  11.  * $address, $city, $state, $province'], $zip, $country, $phone, $cost
  12.  *
  13.  * @package TribeEventsCalendarPro
  14.  * @since  1.0
  15.  * @author Modern Tribe Inc.
  16.  *
  17.  */
  18.  
  19. if ( !defined('ABSPATH') ) { die('-1'); } ?>
  20.  
  21. I want html this to only appear once, at the top
  22.  
  23. <?php
  24.  
  25. $widget_args = tribe_events_get_adv_list_widget_args();
  26. //var_dump($widget_args);
  27. extract($widget_args);
  28.  
  29. ?>
  30.  
  31.  
  32. <li>
  33.     <h4 class="entry-title summary">
  34.         <a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a>
  35.     </h4>
  36.     <div class="duration">
  37.             <?php echo tribe_events_event_schedule_details(); ?>   
  38.     </div>
  39.     <?php if ( $cost && tribe_get_cost() != '' ) { ?>
  40.         <span class="tribe-events-divider">|</span>
  41.         <div class="tribe-events-event-cost">
  42.             <?php echo tribe_get_cost( null, true ); ?>
  43.         </div>
  44.     <?php } ?>         
  45.     <div class="vcard adr location">   
  46.  
  47.  
  48.         <?php
  49.         // if we are using this instance of the widget as the "show next event" for home page,
  50.         // then display full event content
  51.         if ($title == "Next Event"){
  52.         ?>
  53.             <span class="fn org tribe-venue"><?php echo the_content(); ?></span>
  54.         <?php } ?>
  55.        
  56.        
  57.         <?php if ( $venue  && tribe_get_venue() != '') { ?>
  58.             <span class="fn org tribe-venue"><?php echo tribe_get_venue_link(); ?></span>
  59.         <?php } ?>
  60.  
  61.         <?php if ( $address && tribe_get_address() != '' ) { ?>
  62.             <span class="street-address"><?php echo tribe_get_address(); ?></span>
  63.         <?php } ?>
  64.  
  65.         <?php if ( $city && tribe_get_city() != '' ) { ?>
  66.             <span class="locality"><?php echo tribe_get_city(); ?></span>
  67.         <?php } ?>
  68.  
  69.         <?php if ( $region && tribe_get_region() !='' ) { ?>
  70.             <span class="region"><?php echo tribe_get_region(); ?></span>
  71.         <?php   } ?>
  72.  
  73.         <?php if ( $zip && tribe_get_zip() != '' ) { ?>
  74.             <span class="postal-code"><?php echo tribe_get_zip(); ?></span>
  75.         <?php } ?>
  76.  
  77.         <?php if ( $country  && tribe_get_country() != '') { ?>
  78.             <span class="country-name"><?php echo tribe_get_country(); ?></span>
  79.         <?php } ?>
  80.  
  81.         <?php if ( $organizer && tribe_get_organizer() != '' ) { ?>
  82.         <?php _e( 'Organizer:', 'tribe-events-calendar-pro' ); ?>
  83.                 <span class="tribe-organizer"><?php echo tribe_get_organizer_link(); ?></span>
  84.         <?php } ?>
  85.  
  86.         <?php if ( $phone && tribe_get_phone() != '' ) { ?>
  87.             <span class="tel"><?php echo tribe_get_phone(); ?></span>
  88.         <?php } ?>
  89.     </div>
  90. </li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement