WordPress 3.5beta1のアナウンスの下の方にTwenty Twelveのリリースについて触れられていたので、インストールしてテーマを変更してみた。
インストール
ダッシュボードの外観→テーマを開き、「テーマのインストール」タブを開く。
twentytwelveで検索すると出てくるのでインストールを押す。
子テーマの作成
そのまま、このテーマを適用してもいいけど、いじるときに元のファイルを触りたくないので、子テーマを作って変更するところだけファイルを用意するようにする。
ウェブからはできないので、サーバにログイン
%cd www/snapshots/wp-content/themes/ %mkdir snapshots2012 %vi style.css %vi functions.php
style.cssには親テーマを定義するコメント行を書く。
/* Theme Name: Snapshots 2012 Description: Child theme for the Twenty Twelve theme Author: s.ueda Author URI: http://aperire.sakura.ne.jp/snapshots/ Template: twentytwelve Version: 1.0.0 */
functions.phpには、どのスタイルシートを呼ぶのかを書く。
<?php
// load stylesheet
if ( !is_admin() ) {
    wp_enqueue_style(
        'twentytwelve-style',
        get_template_directory_uri() . '/style.css',
        array(),
        date('YmdHis', filemtime(get_template_directory() . '/style.css'))
        );
    wp_enqueue_style(
        'snapshots2012-style',
        get_stylesheet_uri(),
        array('twentytwelve-style'),
        date('YmdHis', filemtime(get_stylesheet_directory() . '/style.css'))
        );
}
少しカスタマイズ
そのままだと記事のタイトル付近に日付が出なくて少しさみしいのでcontent.phpをいじって日時を出すようにしてみた。
%diff -uN twentytwelve/content.php snapshots2012/content.php
--- twentytwelve/content.php    2012-10-16 21:11:10.000000000 +0900
+++ snapshots2012/content.php   2012-10-16 22:48:41.000000000 +0900
@@ -5,6 +5,8 @@
  * @package WordPress
  * @subpackage Twenty_Twelve
  * @since Twenty Twelve 1.0
+ *
+ * modified by s.ueda
  */
 ?>
@@ -18,10 +20,12 @@
                        <?php the_post_thumbnail(); ?>
                        <?php if ( is_single() ) : ?>
                        <h1 class="entry-title"<>?php the_title(); ?></h1>
+                       <p><?php the_time('Y/m/d H:i') ?></p>
                        <?php else : ?>
                        <h1 class="entry-title">
                                <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
                        </h1>
+                       <p><?php the_time('Y/m/d H:i') ?></p>
                        <?php endif; // is_single() ?>
                        <?php if ( comments_open() ) : ?>
                                <div class="comments-link">
その他
ついでにTwitterのウィジェットを変更して、ヘッダーのメニュー構成も少し変えてみた。