<?php
/*
Template Name: Single Post Template
*/
?>
<?php get_header(); ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<div id="breadcrumb">
    <ul class="bread_crumb">
        <li><a href="<?php echo home_url(); ?>">ホーム</a></li>
        <li>/</li>
        <?php
        $categories = get_the_category();
        if ($categories) {
            echo '<li><a href="' . get_category_link($categories[0]->term_id) . '" rel="category tag">' . $categories[0]->name . '</a></li>';
            echo '<li>/</li>';
        }
        ?>
        <li><?php the_title(); ?></li>
    </ul>
</div><!--breadcrumbList-->

<main>
<!--+++++++++++++++++++++++++++++++++++++++++++++ [contents area start] +++++++++++++++++++++++++++++++++++++++++++++-->
<div id="mainbody">
<!--====================== [[unit area start]] ======================-->
<section id="pcaEntryBody" class="section tweenBlock">
<div class="cBlock">

<!--/////////// [[[unit area start]]] ///////////-->
<div class="articleInfoArea">
    <ul class="catLabelList">
        <?php the_category(); ?>
    </ul>
    <div class="articleDate">
        <span class="dateTxt">
            記事公開日：<time datetime="<?php echo get_the_time('c'); ?>"><?php echo get_the_time('Y年n月j日'); ?></time>
            <?php if (get_the_time('Y-m-d') != get_the_modified_time('Y-m-d')) : ?>
            <br>記事更新日：<time datetime="<?php echo get_the_modified_time('c'); ?>"><?php echo get_the_modified_time('Y年n月j日'); ?></time>
            <?php endif; ?>
        </span>
    </div>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div class="titStyle"><h1 class="titleArea"><?php the_title(); ?></h1></div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div id="pcaEntryMv">
    <figure class="figArea revealBlock1">
        <p class="revealArea">
            <?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('post-thumbnail');
            }
            ?>
        </p>
    </figure>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div id="pcaEntryContents" class="post news">
    <?php the_content(); ?>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div class="shareArea">
    <ul class="shareList">
        <li class="twitter">
            <a href="https://twitter.com/intent/tweet?url=<?php echo urlencode(get_permalink()); ?>&text=<?php echo urlencode(get_the_title()); ?>" target="_blank" rel="noopener noreferrer">
                <span>Twitter</span>
            </a>
        </li>
        <li class="facebook">
            <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(get_permalink()); ?>" target="_blank" rel="noopener noreferrer">
                <span>Facebook</span>
            </a>
        </li>
        <li class="line">
            <a href="https://line.me/R/msg/text/?<?php echo urlencode(get_the_title() . ' ' . get_permalink()); ?>" target="_blank" rel="noopener noreferrer">
                <span>LINE</span>
            </a>
        </li>
    </ul>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div class="authorArea">
    <div class="authorInfo">
        <span class="authorLabel">Text by</span>
        <span class="authorName"><?php the_author(); ?></span>
    </div>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div class="tagArea">
    <?php the_tags('<ul class="tagList"><li>', '</li><li>', '</li></ul>'); ?>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

<!--/////////// [[[unit area start]]] ///////////-->
<div class="relatedArea">
    <?php
    if (class_exists('Jetpack_RelatedPosts')) {
        echo do_shortcode('[jetpack-related-posts]');
    }
    ?>
</div>
<!--/////////// [[[//unit area end]]] ///////////-->

</div><!-- .cBlock -->
</section>
<!--====================== [[//unit area end]] ======================-->

</div><!-- #mainbody -->
<!--+++++++++++++++++++++++++++++++++++++++++++++ [//contents area end] +++++++++++++++++++++++++++++++++++++++++++++-->
</main>

<?php endwhile; endif; ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
