WordPress自作テーマ kunai
index.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 rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <?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(); ?> <?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_content( sprintf ( __( 'Read more...' ) ) ); ?> <?php wp_link_pages( array ( 'link_before' => '<span class="page-links">' , 'link_after' => '</span>' ) ); ?> </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(); ?>
コメントを残す