<?php  get_header(); ?>

        <?php global $wp; ?>
            
                <section class="blog-text">
                <h1>
                    <?php
                        global $post;
                        $postcat = get_the_category( $post->ID );                
                        if ( !empty( $postcat ) ) {
                            echo esc_html( $postcat[0]->name );   
                        }
                    ?>
                </h1>
                </section>

                <main>
                    <section class="articles">
                        <?php if ( have_posts() ) : 
                                while ( have_posts() ) : the_post(); 
                            ?>
                            <article class="single-post">
                                <figure>
                                    <a href="<?=the_permalink()?>" title="<?=the_title()?>"></a>
                                    <?php if(has_post_thumbnail()) {
                                            the_post_thumbnail( 'post-thumbnails');
                                        }
                                    ?>
                                </figure>
                                <section class="post-data">
                                    <h3>
                                        <a href="<?=the_permalink()?>"><?=the_title()?></a>
                                    </h3>
                                    <p>
                                        <?=substr(get_the_excerpt(), 0,110)?>...
                                    </p>
                                </section>
                            </article>
                        <?php endwhile; endif; ?>
                    </section>
                </main>
       
    <?php get_footer(); ?>


<?php wp_footer(); ?>

