File: D:/HostingSpaces/MDalebout3/prdct.nl/wwwroot/wp-content/themes/theme/blocks/block-facts-figures.php
<?php
/**
* Facts and figures Template.
*
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.
*/
// Create id attribute allowing for custom "anchor" value.
$id = 'facts-figures-' . $block['id'];
if( !empty($block['anchor']) ) {
$id = $block['anchor'];
}
// Create class attribute allowing for custom "className" and "align" values.
$className = 'facts-figures';
if( !empty($block['className']) ) {
$className .= ' ' . $block['className'];
}
if( !empty($block['align']) ) {
$className .= ' align' . $block['align'];
}
// Load values and assign defaults.
$bg_image = get_field('bg_image') ?: [];
$facts = get_field('facts');
?>
<?php if (!empty($facts)) { ?>
<section class="block-facts-figures initial">
<div class="facts-wrapper" style="background-image: url('<?php echo $bg_image['url']; ?>')">
<div class="block-facts-background"></div>
<div class="block-facts-wrapper">
<?php foreach ($facts as $fact) {?>
<div class="block-fact">
<div class="block-fact-big"><?php echo $fact['big_text']; ?></div>
<div class="block-fact-small"><?php echo $fact['small_text']; ?></div>
</div>
<?php } ?>
</div>
</div>
</section>
<?php } ?>