$ cat contents/tech/176.md
WordPress子テーマの作り方

既存のテンプレートを編集すると、元に戻したりテーマ自体のバージョンアップが発生した時に困ります。子テーマを使うと既存のテーマを変更することなく必要な部分のみ変更することが出来ます。
子テーマディレクトリを作成する
$ cd ##WordPressがインストールされているパス##/wp-content/themes
$ sudo mkdir twentyseventeen-child
子テーマディレクトリの下に「styple.css」を作成する
/*
Theme Name: Twenty Seventeen Child
Theme URI: http://example.com/twenty-seventeen-child/
Description: Twenty Seventeen Child Theme
Author: Hoge Fuga
Author URI: http://example.com
Template: twentyseventeen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twenty-fifteen-child
*/
もう一つ「functions.php」を作成
<php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
?>
「テーマ」から作成した子テーマを選択します

例)header.phpを編集する
以下のサムネイルを非表示にするように変更してみます

元のファイルをコピーする
$ sudo cp -p ../twentyseventeen/header.php .
編集し以下の部分をコメントにする
<?php
/*
* If a regular post or page, and not the front page, show the featured image.
* Using get_queried_object_id() here since the $post global may not be set before a call to the_post().
*/
/*
if ( ( is_single() || ( is_page() &amp;&amp; ! twentyseventeen_is_frontpage() ) ) &amp;&amp; has_post_thumbnail( get_queried_object_id() ) ) :
echo '&lt;div class="single-featured-image-header"&gt;';
echo get_the_post_thumbnail( get_queried_object_id(), 'twentyseventeen-featured-image' );
echo '&lt;/div&gt;&lt;!-- .single-featured-image-header --&gt;';
endif;
*/
?>
<div class="site-content-contain">
<div id="content" class="site-content">
ページを確認し、サムネイルが表示されていないことを確認する。
以降、必要な時に都度該当ファイルをコピー(ディレクトリの下にあるファイルはディレクトリも作成して)して変更する。
参考