php
1//taxonomy-place_category.php 2<?php 3/** 4 * The template for displaying archive pages 5 * 6 * @link https://codex.wordpress.org/Template_Hierarchy 7 * 8 * @package WordPress 9 * @subpackage Twenty_Seventeen 10 * @since 1.0 11 * @version 1.0 12 */ 13 14get_header(); 15?> 16 17<div class="wrap"> 18 19 <?php if ( have_posts() ) : ?> 20 <header class="page-header"> 21 <?php 22 the_archive_title( '<h1 class="page-title">', '</h1>' ); 23 the_archive_description( '<div class="taxonomy-description">', '</div>' ); 24 ?> 25 </header><!-- .page-header --> 26 <?php endif; ?> 27 28 <div id="primary" class="content-area"> 29 <main id="main" class="site-main" role="main"> 30 31 <?php 32 if ( have_posts() ) : ?> 33 <?php 34 /* Start the Loop */ 35 while ( have_posts() ) : the_post(); 36 37 /* 38 * Include the Post-Format-specific template for the content. 39 * If you want to override this in a child theme, then include a file 40 * called content-___.php (where ___ is the Post Format name) and that will be used instead. 41 */ 42 get_template_part( 'template-parts/post/content', get_post_format() ); 43 44 endwhile; 45 46 the_posts_pagination( array( 47 'prev_text' => twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '<span class="screen-reader-text">' . __( 'Previous page', 'twentyseventeen' ) . '</span>', 48 'next_text' => '<span class="screen-reader-text">' . __( 'Next page', 'twentyseventeen' ) . '</span>' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ), 49 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyseventeen' ) . ' </span>', 50 ) ); 51 52 else : 53 54 get_template_part( 'template-parts/post/content', 'none' ); 55 56 endif; ?> 57 58 </main><!-- #main --> 59 </div><!-- #primary --> 60 <?php get_sidebar(); ?> 61</div><!-- .wrap --> 62 63<?php get_footer();
wordpressでアイキャッチ画像を指定。
archive.phpのコードをコピーしてtaxonomy-place_category.phpを作り、テンプレート階層の優先順位をtaxonomy-place_category.phpにした。
taxonomy-place_category.phpのページは、記事一覧が出ているが、アイキャッチ画像がデフォルトのまま、大きいので、サイズを指定するコードを加えたいがどうすれば良いか。
どなたか宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。