File: /home/globfdxw/diasporameetsafrica.com/wp-content/plugins/lavelo-core/kc/shortcodes/wandw/wandw.php
<?php
/* ==========================================================
Accordion
=========================================================== */
if ( !function_exists('lavelo_wandw_function')) {
function lavelo_wandw_function( $atts, $content = NULL ) {
extract($atts);
$e_uniqid = uniqid();
$inline_style = '';
if ( $title_color || $title_size || $title_bg ) {
$inline_style .= '.faq-section-'. $e_uniqid .' .theme-wandw-s1 .panel-heading .collapsed {';
$inline_style .= ( $title_color ) ? 'color:'. $title_color .';' : '';
$inline_style .= ( $title_bg ) ? 'background-color:'. $title_bg .';' : '';
$inline_style .= ( $title_size ) ? 'font-size:'.lavelo_core_check_px($title_size) .';' : '';
$inline_style .= '}';
}
if ( $desc_color ) {
$inline_style .= '.faq-section-'. $e_uniqid .' .theme-wandw-s1 .panel-heading + .panel-collapse > .panel-body p {';
$inline_style .= ( $desc_color ) ? 'color:'. $desc_color .';' : '';
$inline_style .= '}';
}
if ( $active_bg ) {
$inline_style .= '.faq-section-'. $e_uniqid .' .theme-wandw-s1 .panel-heading a {';
$inline_style .= ( $active_bg ) ? 'background-color:'. $active_bg .';' : '';
$inline_style .= '}';
}
// add inline style
add_inline_style( $inline_style );
$styled_class = ' faq-section-'. $e_uniqid.' ';
$wandw_items = ( $wandw_items ) ? (array) $wandw_items : array();
ob_start(); ?>
<div class="service-area <?php echo esc_attr( $styled_class.''.$class ); ?>">
<div class="service-area-menu">
<ul class="nav nav-tabs d-flex">
<?php
if ( $wandw_items ) {
$id = 1;
foreach ( $wandw_items as $key => $wandw_item ) {
$id++;
if ( $wandw_item->active_tabs == 'yes') {
$active_class = 'active';
$active_in = 'in';
} else {
$active_class = '';
$active_in = 'in';
} ?>
<li class="<?php echo esc_attr( $active_class ); ?>"><a data-toggle="tab" href="#id_<?php echo $id ?>"><?php echo esc_html( $wandw_item->title ) ?></a></li>
<?php
}
}
?>
</ul>
<div class="tab-content">
<?php
if ( $wandw_items ) {
$id = 1;
foreach ( $wandw_items as $key => $wandw_item ) {
$id++;
if ( $wandw_item->active_tabs == 'yes') {
$active_class = 'active';
$active_in = 'in';
} else {
$active_class = '';
$active_in = ' ';
}
$image_url = wp_get_attachment_url( $wandw_item->wandw_image );
$image_alt = get_post_meta( $wandw_item->wandw_image , '_wp_attachment_image_alt', true); ?>
<div id="id_<?php echo $id ;?>" class="tab-pane fade <?php echo esc_attr( $active_class.' '.$active_in ) ?>">
<div class="Ceremony-wrap">
<div class="row">
<div class="col-lg-5 col-md-5">
<div class="ceromony-img">
<img src="<?php echo esc_url( $image_url ); ?>" alt="<?php echo esc_attr( $image_alt ); ?>">
</div>
</div>
<div class="col-lg-7 col-md-7">
<div class="ceromony-content">
<h3><?php echo esc_html( $wandw_item->title ); ?></h3>
<span class="date"><?php echo esc_html( $wandw_item->wandw_date ); ?></span>
<span><?php echo esc_html( $wandw_item->wandw_address ); ?></span>
<?php echo wp_kses_post( $wandw_item->desc ); ?>
<a class="popup-gmaps" href="<?php echo esc_url( $wandw_item->btn_link ) ?>"><?php echo esc_html( $wandw_item->btn_text ); ?></a>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
}
add_shortcode( 'lav_wandw', 'lavelo_wandw_function' );