<?php /* Template Name: Galeria single */ ?>

<?php $gallery = get_field('gallery'); ?>

<?php get_header() ?>

<section class="category gallery">
    <?php if ($gallery): ?>
        <div class="category__list">
            <?php foreach ($gallery as $item): ?>
                <div class="category__block">
                    <a href="<?php echo $item['url'] ?>">
                        <div class="category__image">
                            <img src="<?php echo $item['sizes']['news_list'] ?>" />
                        </div>
                    </a>

                    <div class="category__title">
                        <?php /*
                        <?php echo $item['title'] ?>
                        */ ?>
                    </div>
                </div>
            <?php endforeach; ?>
        </div>
    <?php else: ?>
        <div class="gallery__desc description">
            <p><strong>Brak zdjęć w tej galeri.</strong></p>
        </div>
    <?php endif; ?>

    <div class="gallery__button">
        <a href="<?= home_url() ?>/o-inwestycji/dziennik-budowy/" class="page__more">
            <div><i class="fa-solid fa-angle-right"></i></div>
            <span>Powrót do kategorii galerii</span>
        </a>
    </div>
</section>

<?php get_footer() ?>