41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
|
|
|
|
|
|
if (! defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
$items = array();
|
|
$p1 = (int) dekart_family_get('family_photo1_image');
|
|
if ($p1) {
|
|
$items[] = array( 'img' => $p1, 'text' => (string) dekart_family_get('family_photo1_text') );
|
|
}
|
|
$p2 = (int) dekart_family_get('family_photo2_image');
|
|
if ($p2) {
|
|
$items[] = array( 'img' => $p2, 'text' => (string) dekart_family_get('family_photo2_text') );
|
|
}
|
|
if (! $items) {
|
|
return;
|
|
}
|
|
?>
|
|
<section class="section-bg reveal family-block family-photos" data-bg="family-photos">
|
|
<div class="container">
|
|
<div class="family-photos__grid">
|
|
<?php foreach ($items as $it) :
|
|
$url = wp_get_attachment_image_url($it['img'], 'large');
|
|
if (! $url) {
|
|
continue;
|
|
}
|
|
?>
|
|
<figure class="family-photos__item">
|
|
<img src="<?php echo esc_url($url); ?>" alt="<?php echo esc_attr($it['text']); ?>" loading="lazy" width="1200" height="800">
|
|
<?php if ($it['text']) : ?>
|
|
<figcaption class="family-photos__cap"><?php echo esc_html($it['text']); ?></figcaption>
|
|
<?php endif; ?>
|
|
</figure>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|