| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/successkpi/wp-content/themes/successkpi/blocks/hero-banner/ |
Upload File : |
<?php
if (function_exists('render_block_preview_image') && render_block_preview_image($block, 'Home banner block preview')) {
return;
}
$className = 'banner-section ' . ($block['className'] ?? '');
?>
<section class="<?php echo esc_attr(trim($className)); ?>">
<div class="container">
<?php
$banner_label = get_field('banner_label') ?? '';
$banner_heading = get_field('banner_heading') ?? '';
$banner_description = get_field('banner_description') ?? '';
?>
<div class="row">
<div class="col-md-6">
<div class="banner-content">
<?php if (!empty($banner_label)) { ?>
<span class="info"><?php echo wp_kses_post($banner_label); ?></span>
<?php } ?>
<?php if (!empty($banner_heading)) { ?>
<h1><?php echo wp_kses_post($banner_heading); ?></h1>
<?php } ?>
<?php if (!empty($banner_description)) { ?>
<p><?php echo esc_html($banner_description); ?></p>
<?php } ?>
<?php
$location = get_field('location');
$date = get_field('date');
?>
<?php if (isset($location, $date) && (!empty($location) || !empty($date))) : ?>
<div class="banner-meta-info">
<?php if (!empty($location)) : ?>
<span class="location">
<?php echo esc_html($location); ?>
</span>
<?php endif; ?>
<?php if (!empty($location) && !empty($date)) : ?>
<span class="separator">|</span>
<?php endif; ?>
<?php if (!empty($date)) :
$date_obj = DateTime::createFromFormat('d/m/Y', $date);
if ($date_obj) : ?>
<span class="date">
<?php echo esc_html($date_obj->format('F d, Y')); ?>
</span>
<?php endif;
endif; ?>
</div>
<?php endif; ?>
<?php
$banner_btn = get_field('banner_button') ?? '';
if ($banner_btn) {
$banner_btn_url = $banner_btn['url'];
$banner_btn_title = $banner_btn['title'];
$banner_btn_target = $banner_btn['target'] ? $banner_btn['target'] : '_self';
?>
<a href="<?php echo esc_url($banner_btn_url); ?>" class="custom-btn" target="<?php echo esc_attr($banner_btn_target); ?>">
<?php echo esc_html($banner_btn_title); ?>
</a>
<?php } ?>
</div>
</div>
<div class="col-md-6">
<?php
$media_type = get_field('banner_media') ?? '';
$banner_image = get_field('banner_image') ?? '';
$banner_video = get_field('banner_video') ?? '';
$banner_video_url = get_field('banner_video_embed') ?? '';
$banner_lottie = get_field('banner_lottie');
$banner_video_thumbnail = get_field('banner_video_thumbnail') ?? '';
?>
<div class="banner-media">
<?php if ($media_type === 'banner_image' && $banner_image) : ?>
<img src="<?php echo esc_url($banner_image['url']); ?>" alt="<?php echo esc_attr($banner_image['alt']); ?>">
<?php elseif ($media_type === 'banner_video' && $banner_video) : ?>
<video playsinline controls id="myVideo" poster="<?php echo esc_url($banner_video_thumbnail['url']); ?>">
<source src="<?php echo esc_url($banner_video['url']); ?>" type="video/mp4">
</video>
<?php elseif ($media_type === 'banner_video_embed' && $banner_video_url) : ?>
<div class="video-embed">
<?php echo $banner_video_url; ?>
</div>
<?php elseif ($media_type === 'banner_lottie' && $banner_lottie) :
$lottie_url = is_array($banner_lottie) ? $banner_lottie['url'] : $banner_lottie;
?>
<lottie-player
class="lottie"
src="<?php echo esc_url($lottie_url); ?>"
background="transparent"
speed="1"
autoplay
loop
style="width:100%;height:auto;">
</lottie-player>
<?php endif; ?>
</div>
</div>
</div>
<div class="banner-logos">
<?php
$logo_rep = get_field('banner_logos') ?? '';
if ($logo_rep):
foreach ($logo_rep as $logo):
$logo_image = $logo['logo_image'];
if (!empty($logo_image)) :
?>
<div class="partner-banner-logo">
<img src="<?php echo esc_url($logo_image['url']); ?>" alt="<?php echo esc_attr($logo_image['alt']); ?>">
</div>
<?php
endif;
endforeach;
endif;
?>
</div>
</div>
</div>
</section>