<?php get_header(); ?>
<main class="page-container">
    <div class="page-hd-bg">
        <div class="sec main relative">
            <h2 class="catch-copy section-title absolute trans-center">ニュース</h2>
        </div>
        <!-- nav -->
        <?php get_template_part('template-parts/navigation'); ?>
        <!-- /nav -->
    </div>
    <div class="post inner-sh flex wrap">
        <?php if (have_posts()) :
            while (have_posts()) :
                the_post(); ?>
                <dl class="new-dl">
                    <a href="<?php the_permalink(); ?>">
                        <dt class="date-time"><?php the_time('Y年m月d日'); ?></dt>
                        <dd class="news-title"><?php the_title(); ?></dd>
                        <!-- <?php echo mb_substr($post->post_title, 0, 30) . ''; ?> -->
                    </a>
                    <!-- <dd><a href="<?php the_permalink(); ?>"><?php echo mb_substr($post->post_title, 0, 30) . ''; ?></a></dd> -->
                </dl>
                <!-- <dl class="new-dl">
                    <a href="<?php the_permalink(); ?>">
                        <?php if (has_post_thumbnail()) {
                            the_post_thumbnail();
                        } else {
                            echo '<img src="' .
                                esc_url(get_template_directory_uri()) .
                                '/assets/img/noimage.png" alt="Noimage">';
                        } ?> 
                        <dd class="news-title"><?php the_title(); ?></dd>
                        <dt class="date-time"><?php the_time('Y.m.d'); ?></dt>
                    </a>
                </dl> -->
            <?php endwhile; ?>
        <?php else : ?>
            <p class="p-preparationTxt">ただいま準備中です。</p>
        <?php endif; ?>
        <?php wp_reset_query(); ?>
        <?php if (paginate_links()) : ?>
    </div>
    <!-- pagenation -->
    <div class="pagenation">
        <?php echo paginate_links([
                'end_size' => 0,
                'mid_size' => 1,
                'prev_next' => true,
                'prev_text' => '<i class="fas fa-angle-left"></i>',
                'next_text' => '<i class="fas fa-angle-right"></i>',
            ]); ?>
    </div><!-- /pagenation -->
<?php endif; ?>
</main>
<?php get_footer(); ?>