Hirobee’s Trail [Memorandum]

サイドバーにカレンダー

by Hirobee on 17:44 Saturday, February 19th, 2005, under Theme, WordPress

カスタマイズその1

  1. サイドバーにカレンダーを表示させる。
  2. カレンダーの今日の日付の背景に色を付ける。
  3. カレンダーの曜日表示のうち、日曜日(S)を赤、土曜日(S)を青の文字にする。

  1. /wp-content/themes/default/sidebar.phpを編集
    カレンダーを表示させたいところにテンプレートタグのget_calendar()を入れる。

    <li>
    <?php get_calendar(); ?>
    </li>

  2. の3行。

  3. /wp-content/themes/default/style.cssを編集
    571行目の後ろに

    #wp-calendar #today {
    background: #99ccff;
    }

  4. の3行を追加。

  5. /wp-includes/template-functions-general.phpを編集
    449行目あたりに、カレンダーのテーブルヘッダ(th)をechoしているところがあるので、

    class="$wd"

    を追加する。
    次に、スタイルシート(wp-content/themes/default/style.css)の205行目の後ろに、

    #wp-calendar th.Sunday {
    color: #ff0000;
    }

    #wp-calendar th.Saturday {
    color: #1e90ff;
    }

    ?

  6. の7行を追加する。

:,

1 Comment for this entry

  • no name

    参考にさせていただきました。ありがとうございます。

    ただ、1の

    の所の”calendar”のスペリングがaがeになってます。
    コピペして使わせてもらった時にerrorが出て気がついたので一応訂正しておきます。

Leave a Reply


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!