Skip to content

Instantly share code, notes, and snippets.

@pochi-web pochi-web/arvchive.php
Last active Nov 12, 2017

Embed
What would you like to do?
archive.phpを作成
<?php/*
Template Name: Archive
*/
?>
<?php get_header();?>
<body>
<?php
$categories = get_the_category();
$tags = get_the_tags();
?>
<header>
<div id="header_layer">
<h1><?php the_archive_title('','の記事');?></h1>
<?php echo category_description();?>
<nav id="header_nav">
</nav>
</div><!--END-header_layer-->
</header>
<main id="category_main" <?php post_class();?>>
<?php if(have_posts()):?>
<?php while(have_posts()):the_post();?>
<section class="articles_index">
<h2><a href="<?php the_permalink(); ?>"><?php echo the_title();?></a></h2>
<time class="date"><?php the_time('Y年n月j日'); ?></time>
<div class="articles_index_thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
<nav id="tag_navigation">
<?php if (the_category()) the_category('<ul id="tag_list"><li class="tag_name">','</li><li class="tag_name">','</li></ul>'); ?>
</nav>
</section>
<?php endwhile;?>
<div id="pager_navigation">
<?php posts_nav_link( ' ', '<i class="fa fa-angle-left icon-left"></i>PREV', 'NEXT<i class="fa fa-angle-right icon-right"></i>' ); ?>
</div>
<?php endif;?>
</main>
<?php get_sidebar(); ?>
<?php get_footer();?>
</body>
</html>
@pochi-web

This comment has been minimized.

Copy link
Owner Author

commented Sep 24, 2017

カテゴリやタグごとにまとめられた一覧ページを作成。
新規要素

  • the_post_thumbnail
  • excerpt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.