WordPressのフッター編集:Twenty Eleven編

WordPressのフッター編集で今日出来るようになったこと。

【フッターにコピーライト表記をつけたい場合の編集方法】


「外観」→「テーマ編集」からfooter.phpファイルを開く。

下の赤字の部分を青字の部分のように編集します。

年度を今年に設定していますが、2010-2013などのようにする場合は
Copyright &copy; 2010-<?php echo date(‘Y’); ?>
という感じにします。

今年出来たサイトだと2013-2013という風になってしまって
くどい感じがするので後半だけ残しました。

この後半部分は自動で更新されるので、
来年になったら2013-の部分を追加すると不自然ではなくなります。

【編集前】
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the id=main div and all content after
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
</div><!– #main –>
<footer id=”colophon” role=”contentinfo”>
<?php
/* A sidebar in the footer? Yep. You can can customize
* your footer with three columns of widgets.
*/
if ( ! is_404() )
get_sidebar( ‘footer’ );
?>
<div id=”site-generator”>
<?php do_action( ‘twentyeleven_credits’ ); ?>
<a href=”<?php echo esc_url( __( ‘http://wordpress.org/’, ‘twentyeleven’ ) ); ?>” title=”<?php esc_attr_e( ‘Semantic Personal Publishing Platform’, ‘twentyeleven’ ); ?>” rel=”generator”><?php printf( __( ‘Proudly powered by %s’, ‘twentyeleven’ ), ‘WordPress’ ); ?></a>
</div>
</footer><!– #colophon –>
</div><!– #page –>
<?php wp_footer(); ?>
</body>
</html>

【編集後】
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the id=main div and all content after
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
</div><!– #main –>
<footer id=”colophon” role=”contentinfo”>
<?php
/* A sidebar in the footer? Yep. You can can customize
* your footer with three columns of widgets.
*/
if ( ! is_404() )
get_sidebar( ‘footer’ );
?>
<div id=”site-generator”>
Copyright &copy; <?php echo date(‘Y’); ?>
<?php bloginfo( ‘name’ ); ?> ALL Rights Reserved.
</div>
</footer><!– #colophon –>
</div><!– #page –>
<?php wp_footer(); ?>
</body>
</html>

これで自動的にサイト名が挿入されますが、リンクは貼られていないので
トップページにリンクを貼りたいときは(2010-2013とした場合)

Copyright &copy; 2010-<?php echo date(‘Y’); ?><a href=”サイトURL”><?php bloginfo( ‘name’ ); ?></a> All Rights Reserved.

という風に加えます。  出来た?

(Visited 152 times, 1 visits today)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください