Untitled diff

Created Diff never expires
3 removals
94 lines
4 additions
95 lines
<?php
<?php
/**
/**
* List View Loop
* List View Loop
* This file sets up the structure for the list loop
* This file sets up the structure for the list loop
*
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php
*
*
* @version 4.4
* @version 4.4
* @package TribeEventsCalendar
* @package TribeEventsCalendar
*
*
*/
*/


if ( ! defined( 'ABSPATH' ) ) {
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
die( '-1' );
} ?>
} ?>


<?php
<?php
global $post;
global $post;
global $more;
global $more;
$more = false;
$more = false;
?>
?>


<div class="tribe-events-loop full-width">
<div class="tribe-events-loop full-width">


<script>
<script>
jQuery(function($) {
jQuery(function($) {
// Let's get the parameter value of 'tribe-bar-search'
// Let's get the parameter value of 'tribe-bar-search'
// And update our h2#courseAvailabilityHeader text!
// And update our h2#courseAvailabilityHeader text!
var getUrlParameter = function getUrlParameter(sParam) {
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sURLVariables = sPageURL.split('&'),
sParameterName,
sParameterName,
i;
i;


for (i = 0; i < sURLVariables.length; i++) {
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
sParameterName = sURLVariables[i].split('=');


if (sParameterName[0] === sParam) {
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
}
}
};
};


var courseType = getUrlParameter('tribe-bar-search');
var courseType = getUrlParameter('tribe-bar-search');
if(courseType !== undefined) {
if(courseType !== undefined) {
var arr = courseType.split('+');
var arr = courseType.split('+');
var courseType = arr[0];
var courseType = arr[0];
var courseLocation = arr[1];
var courseLocation = arr[1];
// if not empty parameter, then say something nice!
// if not empty parameter, then say something nice!
if(!(arr.length === 1 && arr[0] === '')) {
if(!(arr.length === 1 && arr[0] === '')) {
$('#courseAvailabilityHeader').text('All available Courses for ' + courseType + ' ' + courseLocation);
$('#courseAvailabilityHeader').text('All available Courses for ' + courseType + ' ' + courseLocation);
}
}


}
}


});
});
</script>
</script>
<h2 id="courseAvailabilityHeader">All available Courses</h2>
<h2 id="courseAvailabilityHeader">All available Courses</h2>


<div class="row">
<div class="row">
<?php while ( have_posts() ) : the_post(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php do_action( 'tribe_events_inside_before_loop' ); ?>
<div class="col-12 col-lg-4">
<div class="col-12 col-lg-4">
<?php do_action( 'tribe_events_inside_before_loop' ); ?>


<!-- Event -->
<!-- Event -->
<?php
<?php
$post_parent = '';
$post_parent = '';
if ( $post->post_parent ) {
if ( $post->post_parent ) {
$post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"';
$post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"';
}
}
?>
?>

<div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>" <?php echo $post_parent; ?>>
<div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>" <?php echo $post_parent; ?>>
<?php
<?php
$event_type = tribe( 'tec.featured_events' )->is_featured( $post->ID ) ? 'featured' : 'event';
$event_type = tribe( 'tec.featured_events' )->is_featured( $post->ID ) ? 'featured' : 'event';


/**
/**
* Filters the event type used when selecting a template to render
* Filters the event type used when selecting a template to render
*
*
* @param $event_type
* @param $event_type
*/
*/
$event_type = apply_filters( 'tribe_events_list_view_event_type', $event_type );
$event_type = apply_filters( 'tribe_events_list_view_event_type', $event_type );


tribe_get_template_part( 'list/single', $event_type );
tribe_get_template_part( 'list/single', $event_type );
?>
?>
</div>
</div>



</div>
<?php do_action( 'tribe_events_inside_after_loop' ); ?>
<?php do_action( 'tribe_events_inside_after_loop' ); ?>
</div>
<?php endwhile; ?>
<?php endwhile; ?>
</div>
</div>


</div><!-- .tribe-events-loop -->
</div><!-- .tribe-events-loop -->