Amy-Mir / loop-templates / sponsors.php
sponsors.php
Raw
<?php
/**
 * The template part for displaying sponsors logo images
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

$getSponsors = get_field('sponsors','options');
$isScrolling = sizeof($getSponsors) > 3 ? '--animated' : '--static';

?>

<div id="--SSW">
    <div class="container">
        <h1 class="heading1">Mine samarbeidspartnere</h1>
    </div>
    <div class="sponsors__wrapper <?php echo esc_attr($isScrolling); ?>">
        <div class="sponsors__logosHolder">
            <?php foreach($getSponsors as $sponsor): ?>
                <div class="sponsors__logo">
                    <img src="<?php echo esc_attr($sponsor['sponsor_logo']['url']); ?>" 
                        alt="<?php echo esc_attr($sponsor['sponsor_logo']['alt']); ?>" >
                </div>
            <?php endforeach; ?>
        </div>
    </div>
</div>