質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

Q&A

解決済

1回答

3809閲覧

アーカイブページで表示されるアイキャッチ画像のサイズを小さく変更したい。

destrudo

総合スコア143

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

0グッド

0クリップ

投稿2017/05/06 03:25

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のページは、記事一覧が出ているが、アイキャッチ画像がデフォルトのまま、大きいので、サイズを指定するコードを加えたいがどうすれば良いか。

どなたか宜しくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

wp-content\themes\twentyseventeen\template-parts\post\content.php

PHP

1 2<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>

がアイキャッチ画像を表示しているはずなので、こちらに引数を加えてサイズを設定してください。

https://wpdocs.osdn.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/the_post_thumbnail

投稿2017/05/06 03:32

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問