<?php
if (!defined('ABSPATH')) { exit; }
get_header();
?>

<div class="bp-page-head">
    <h1>Wyniki wyszukiwania</h1>
    <div class="bp-meta"><?php echo esc_html(get_search_query()); ?></div>
</div>

<?php if (have_posts()): ?>
    <?php while (have_posts()): the_post(); ?>
        <article class="bp-article-card">
            <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
            <p class="bp-excerpt"><?php echo esc_html(wp_trim_words(get_the_excerpt(), 30)); ?></p>
        </article>
    <?php endwhile; ?>
<?php else: ?>
    <div class="bp-article-card"><p>Brak wynikow.</p></div>
<?php endif; ?>

<?php get_footer(); ?>

