HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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 } ?>