kunai

Just another WordPress site

kunai

WordPress 自作テーマ kunai 配布

WordPress自作テーマ kunai archive.php

WordPress自作テーマ kunai

archive.phpのコード

カスタマイズを前提で、どうぞ。

<!DOCTYPE html>
<html <?php language_attributes(); ?>>

<head>
<meta charset="<?php bloginfo('charset'); ?>">


<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">

<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">


<?php if ( is_singular() ) wp_enqueue_script( "comment-reply" ); ?>

<?php wp_head(); ?>

</head>



<body <?php body_class(); ?>>



<div id="wrapper">



<header>

<div class="site-branding">
<h1 class="site-title"><a href="<?php echo home_url('/'); ?>"><?php bloginfo('name'); ?></a></h1>
<p class="site-description"><?php bloginfo('description'); ?></p>
</div>


<div><img src="<?php header_image(); ?>" alt="<?php bloginfo('name'); ?>"></div>

</header>



<?php wp_nav_menu(); ?>



<div clas="page-header">
<h1 class="page-title"><?php echo get_the_archive_title(); ?><?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; echo ' Page'.$paged.''; ?></h1>
</div>



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



<article>

<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

<p class="entry-meta"><?php the_time( 'Y-m-d' ); ?></p>



<div class="entry-content">

<?php edit_post_link( __( 'Edit This' ) , '<p>', '</p>' ); ?>



<?php the_excerpt(); ?>


</div><!-- /entry-content -->


</article>



<?php endwhile; else: ?>



<article>
<p>Not Found</p>
</article>



<?php endif; ?>





<?php the_posts_pagination( array(
	'mid_size' => 2,
	'prev_text' => __( 'Previous' ),
	'next_text' => __( 'Next' ),
	'screen_reader_text' => __( 'Posts navigation' )
) ); ?>





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

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

kunai

WordPress 自作テーマ kunai 配布