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

<?php
$the_query = new WP_Query(array(
    'post_type'         => 'galeria',
    'post_status'       => 'publish',
    'orderby' => 'date',
    'order'   => 'DESC',
));
?>

<?php get_header() ?>

<section class="category gallery">
    <?php if ($the_query->have_posts()) : ?>
        <div class="category__list">
            <?php while ($the_query->have_posts()) : ?>
                <?php $the_query->the_post(); ?>
                <div class="category__block">
                    <div class="category__image">
                        <a href="<?php the_permalink(); ?>" class="post-thumbnail">
                            <?php the_post_thumbnail('news_list'); ?>
                        </a>
                    </div>
                    <h2 class="category__title">
                        <a href="<?php the_permalink(); ?>"><?php echo shortString(get_the_title(), 70) ?></a>
                    </h2>

                    <a href="<?php the_permalink(); ?>" class="category__more">
                        <svg viewBox="0 0 14 5">
                            <g clip-path="url(#clip0_144_838)">
                                <path d="M14 5H0V3.37919H7.31616L3.55331 1.43763L4.31005 0L14 5Z" />
                            </g>
                        </svg>
                    </a>
                </div>
            <?php endwhile; ?>
        </div>
        <?php the_paginate(); ?>
    <?php else : ?>
        <p>Brak postów w tej kategorii.</p>
    <?php endif; ?>
</section>

<?php get_footer() ?>