<div class="subpage articles">
    <?php require(get_template_directory() . '/subpage-top.php'); ?>

    <div id="blog" class="content">
        <h1>Blog - drobnicamorska.pl</h1>
        
        
            <div id="posty">
                <main>

                    <?php

                    global $wp_query;
                    $wp_query = new WP_Query(array(
                        'posts_per_page' => 3,
                        'paged' => getPaginationPageNumber()
                    ));

                    if (have_posts()) {
                        while (have_posts()) {
                            the_post();
                    ?>
                        <div class="post">
                            <a href="<?php the_permalink(); ?>"><div class="post-thumbnail"><?php the_post_thumbnail( 'full' ); ?></div></a>
                            <div class="blog-title"><p><?php the_category( ', ' ); ?> <br><?php the_tags( 'Tagi: ', ', ', '<br />' ); ?>
                            <a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a><p></div>

                            <p><?php echo get_excerpt(500); ?>...</p>
                            <div class="form-group buttons"><a href="<?php the_permalink(); ?>"><button class="button orange"> Czytaj dalej<div class="arrow-right"></div></button></a></div><div class="orange-square bottom"></div>
                        </div>            
                </main>       
                <?php
                }
                pagination_nav();}
                ?>
            </div>
            <?php get_sidebar('blog'); ?>  
        
    </div>
    <?php require(get_template_directory() . '/subpage-calculator.php'); ?>
    </div>