File: /home/globfdxw/diasporameetsafrica.com/wp-content/plugins/lavelo-core/kc/shortcodes/event/event.php
<?php
/* ==========================================================
Testimonials
=========================================================== */
if ( !function_exists('lavelo_event_function')) {
function lavelo_event_function( $atts, $content = NULL ) {
extract($atts);
if ( $title_size || $title_color ) {
$title_style = ' style="';
$title_style .= $title_size ? 'font-size: '. lavelo_plugin_check_px($title_size) .';': '';
$title_style .= $title_color ? 'color: '.$title_color : '';
$title_style .= '"';
} else {
$title_style = '';
}
if ( $desc_size || $desc_color ) {
$desc_style = ' style="';
$desc_style .= $desc_size ? 'font-size: '. lavelo_plugin_check_px($desc_size) .';': '';
$desc_style .= $desc_color ? 'color: '.$desc_color : '';
$desc_style .= '"';
} else {
$desc_style = '';
}
if ( $content_color ) {
$content_style = ' style="';
$content_style .= $content_color ? 'background-color: '.$content_color : '';
$content_style .= '"';
} else {
$content_style = '';
}
$event_items = ( $event_items ) ? (array) $event_items : array();
ob_start(); ?>
<div class="event-area <?php echo esc_attr( $class); ?>">
<?php
$event_count = 0;
foreach ($event_items as $key => $event_item ) {
$event_count++;
$image_url = wp_get_attachment_url( $event_item->event_image );
$image_alt = get_post_meta( $event_item->event_image, '_wp_attachment_image_alt', true);
if( $event_count % 2 === 0 ){ ?>
<div class="single-event">
<div class="row">
<div class="col-md-6">
<div class="event-content">
<h2><?php echo esc_html( $event_item->title ); ?></h2>
<div class="event-time">
<i class="fa fa-map-marker"></i>
<span ><?php echo esc_html( $event_item->event_time ); ?></span>
</div>
<div class="location">
<i class="fa fa-clock-o"></i>
<span><?php echo esc_html( $event_item->event_location); ?></span>
</div>
<p><?php echo esc_html( $event_item->event_desc ); ?></p>
<a href="<?php echo esc_url( $event_item->event_link ); ?>" class="enent-link popup-gmaps"><?php echo esc_html( $event_item->link_text ); ?></a>
</div>
</div>
<div class="col-md-6">
<div class="event-img">
<img src="<?php echo esc_url( $image_url ); ?>" alt="<?php echo esc_attr( $image_alt ); ?>">
</div>
</div>
</div>
</div>
<?php } else { ?>
<div class="single-event">
<div class="row">
<div class="col-md-6">
<div class="event-img">
<img src="<?php echo esc_url( $image_url ); ?>" alt="<?php echo esc_attr( $image_alt ); ?>">
</div>
</div>
<div class="col-md-6">
<div class="event-content">
<h2><?php echo esc_html( $event_item->title ); ?></h2>
<div class="event-time">
<i class="fa fa-map-marker"></i>
<span ><?php echo esc_html( $event_item->event_time ); ?></span>
</div>
<div class="location">
<i class="fa fa-clock-o"></i>
<span><?php echo esc_html( $event_item->event_location); ?></span>
</div>
<p><?php echo esc_html( $event_item->event_desc ); ?></p>
<a href="<?php echo esc_url( $event_item->event_link ); ?>" class="enent-link popup-gmaps"><?php echo esc_html( $event_item->link_text ); ?></a>
</div>
</div>
</div>
</div>
<?php } } ?>
</div>
</div>
<?php return ob_get_clean();
}
}
add_shortcode( 'lov_event', 'lavelo_event_function' );