今回は、2015年末に公開されたWordpressの最新デフォルトテーマの「Twenty Sixteen」のカスタマイズTIPSです。
このテーマ、デフォルトだとフッター部分のコピーライト表記部分にProudly powered by WordPressと入っています。
このままですと、せっかく作ったサイトの著作権がWordpressにあると言っていることになってしまいますし、よろしくありません。
今回はこのコピーライト表記部分をカスタマイズしていこうと思います。
フォントの変更や、余白調整、スライドショーの挿入、固定ページをトップページにする方法などは過去の記事をご参考ください。
「Twenty Sixteen」の関連記事はこちらをどうぞ
WordPressデフォルトテーマ「Twenty Sixteen」が公開。その特徴とカスタマイズ性は?
【Twenty Sixteenカスタマイズ】フォントを変更する方法
【Twenty Sixteenカスタマイズ】ロゴを配置する・メニューを作成する方法
【Twenty Sixteenカスタマイズ】トップページにスライドショーを挿入する方法
【Twenty Sixteenカスタマイズ】トップページのタイトルを削除・見出しタグ(段落)を装飾する方法
まずは、「サイト名 Proudly powered by WordPress」となっているフッター部分コピーライト表記を変更しましょう。
今回は、こちらを「Copyright 2016 Cocoa inc. All Rights Reserved.」に変更します。よくあるサイトみたいですね!
「外観」>「テーマの編集」より「テーマフッター(footer.php)」を選択してください。
右側にずらずらと並んでいる中から選べばOKです。
開いたら、このボックスの中にある文章を適当なエディタへコピペしましょう。
直接編集してもいいのですが、バックアップの意味もありますので、できればエディタで編集したほうが良いです。
エディタなんかないよ!という方は、フリーソフトでダウンロードできます。シンプルなエディタでは以下のサクラエディタがおすすめです。
【フリーソフト】サクラエディタ 公式サイト(Windows)
41~52行目
<div class="site-info"> <?php /** * Fires before the twentysixteen footer text for footer customization. * * @since Twenty Sixteen 1.0 */ do_action( 'twentysixteen_credits' ); ?> <span class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span> <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentysixteen' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentysixteen' ), 'WordPress' ); ?></a> </div><!-- .site-info -->
こちらの赤字の部分をまるまる「Copyright 2016 Cocoa inc. All Rights Reserved.」に置き換えます。
これで文字の置き換えは完了したのですが、例えば2017年を迎えたときに
「Copyright 2017 Cocoa inc. All Rights Reserved.」
のように自動的に年数が増えていくとさらに便利です。
そういった場合は、さらに応用します。
現在、41行目以降はこうなっています。
<div class="site-info"> Copyright 2016 Cocoa inc. All Rights Reserved. </div><!-- .site-info -->
年数部分を以下のコードに置き換えてください。
<div class="site-info">
Copyright <?php echo date('Y'); ?> Cocoa inc. All Rights Reserved.
</div><!-- .site-info -->
これで、自動的に現在の年のコピーライトに変わります。
以上で、コピーライト表記が置き換わったと思います。
Cocoa inc.の部分は任意の文字列に置き換えてくださいね!
「Twenty Sixteen」の関連記事はこちらをどうぞ
WordPressデフォルトテーマ「Twenty Sixteen」が公開。その特徴とカスタマイズ性は?
【Twenty Sixteenカスタマイズ】フォントを変更する方法
【Twenty Sixteenカスタマイズ】ロゴを配置する・メニューを作成する方法
【Twenty Sixteenカスタマイズ】トップページにスライドショーを挿入する方法
【Twenty Sixteenカスタマイズ】トップページのタイトルを削除・見出しタグ(段落)を装飾する方法
Cookie | 期間 | 説明 |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |