<?php
/**
 * 首页模板
 */
?>
<?php get_header(); ?>

<div class="container">
    <div class="row">
        <div class="col-md-8">
            <?php if (have_posts()) : ?>
                <?php while (have_posts()) : the_post(); ?>
                    <article id="post-<?php the_ID(); ?>" <?php post_class('panel panel-default'); ?>>
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                            </h3>
                        </div>
                        <div class="panel-body">
                            <?php the_excerpt(); ?>
                            <a href="<?php the_permalink(); ?>" class="btn btn-primary">阅读更多</a>
                        </div>
                    </article>
                <?php endwhile; ?>
                <?php the_posts_pagination(array(
                    'prev_text' => '上一页',
                    'next_text' => '下一页',
                )); ?>
            <?php else : ?>
                <p>暂无文章。</p>
            <?php endif; ?>
        </div>
        <div class="col-md-4">
            <?php get_sidebar(); ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>