Tanzaku v1.1解説

カスタマイズをする上での参考情報です。
以下、Tanzakuバージョン1.1、WPバージョン2.9 を元に解説します。

*The trouble of One post was corrected.
*投稿数が1つの場合、内容が反映されない不具合を修正しました。

グリッドカラムの上限倍幅を指定する

<編集箇所:index.php>

[grid column setting]の箇所の、$max_colを変更します。1を指定すると、グリッドがすべて最小幅で表示されるようになります。3を指定すると、最大で3倍幅までグリッドが拡張されます。幅はグリッド内のコンテンツ(画像、ビデオ等)の大きさによって変化します。

$max_col = 2; // max column size (style div.x1 ~ xN)

グリッドのカラム幅、パディング・マージン等の数値を調節する

<編集箇所:style.css>

“Grid Items, Single Item and Comments”の箇所、div.x1からの箇所を変更します。

div.x1 { width:  290px; }
div.x2 { width:  615px; }
div.x3 { width:  940px; }
div.x4 { width: 1265px; }

カラム幅の倍数Nに対して「(幅 × N) + ギャップ幅 × (N – 1) 」の式で数値を求めます。ギャップ幅はパディング、マージン(もしあればボーダーも)の横幅に影響する数値を合算して指定します。ギャップ幅は下記のスタイルが関係します。

div.grid-item,
div.single-item {
	overflow: hidden;
	margin: 0 5px 5px 0;
	padding: 15px 15px 30px 15px;
	border: 0;
	background-color: #7b7f8b;
}

このほか、画面下部に配置されるサイドバー2(#sidebar2 li.widget)の調整も考慮してください。

<編集箇所:index.php>

[grid column setting]の箇所の、$col_w(カラム幅), $gap_w(ギャップ幅)を変更します。

$col_w = 290; // width of grid column
$gap_w = 35;  // padding + margin-right (15+15+5)

<編集箇所:header.php>

Javascriptコードの gridDefWidth に、index.phpで指定した$col_w, $gap_wの合計値を指定します。

gridDefWidth: 290 + 15 + 15 + 5,

moreタグによる遷移先ページでの余計な移動を無効にする

moreタグによって生成されるリンク(本テーマでは “Details »”表示)にはフラグメント(#記号)が通常含まれているため、それをクリックするとクリック先の該当箇所に瞬時に移動してしまい、詳細ページのアニメーション効果が中途半端になってしまいます。この現象の修正に次のプラグインの導入をおすすめします。

WordPressのmoreタグを変更するプラグイン MoreLink#Remove
http://debeso.com/blog/2008/12/wordpress/morelinksharpremove/

画像にポップアップ系効果を追加する

Lightbox2プラグインなど、画像をポップアップ化するプラグインと併用できます。サムネイル画像に対して画像リンクが張られていれば、これらのプラグインを利用してポップアップ表示が可能になります。ただしメインインデックスで各グリッドに1つだけ表示される画像には、詳細ページへのリンクが強制的に張られます(画像へのリンクがあっても削除されます)。そのためメインインデックスのグリッド内の画像もポップアップ化するには下記の指定を変更します。

<編集箇所:index.php>

[grid image link setting]の箇所、$flg_img_forcelinkをfalseに変更します。

$flg_img_forcelink = false;   // add/overwrite a link which links to a single post (permalink).

投稿でのサムネイルの埋め込み方

投稿エディタで画像を挿入する際に、下のほうの「リンクURL」と「サイズ」を確認します。リンクURLには「ファイルのURL」ボタンを押してオリジナルサイズの画像へのリンクを貼り、サイズに「サムネイル」「中サイズ」など小さめのサイズを選択します。

WPの管理画面>メディア設定画面でサムネイル画像の設定ができます。ここのサイズをグリッドのカラム幅と合わせておいても良いかもしれません(ただし合わせてなくても、このテーマは自動的に画像サイズをグリッドにフィットさせます)。
サムネイルの場合、「実寸法にトリミング」チェックボックスにチェックを入れておくと完全に縦横の画像サイズを固定化することもできます。グリッドを縦横に規則正しく整列させたい場合はこのオプションを利用すると良いでしょう。

メディア設定画面

詳細ページでサムネイル画像を大きく表示する

<編集箇所:index.php>

[grid image link setting]の箇所、$flg_img_extractをtrueに変更します。最初のサムネイル画像に画像へのリンクが張られていれば、詳細ページでリンクを画像タグに展開して表示します。

$flg_img_extract = true;    // in single post page, extract thumbnail link to an original image.

ビデオを表示する

Youtubeなど動画共有サイトのタグ埋め込み(obejctタグ)に対応しています。
投稿エディタの「HTMLタブ」を開いてタグを貼りつけます。

また、WP2.9からの新機能では動画共有サイトのURLをじかに記述するだけでもビデオの埋め込み(objectタグへの変換)ができるようになっています。

自前のサーバー内のビデオを表示する

WPのメディアライブラリにアップロードしたビデオも挿入できます。投稿エディタ(ビジュアルタブ)を開き、ツールバーの右端「アドバンスとツールバー」ボタンを押してツールバーの2段目を表示します。その中の「埋め込みメディアの挿入」ボタンを使います。

WP投稿エディタ(ツールバー:埋め込みメディアの挿入)

ビデオ埋め込み用プラグインも利用できます(Embedded Videoプラグインで確認)。
基本的にビデオ用に生成されるobjectタグやembedタグにwidth, height属性がセットされていればグリッドにフィットします。

ビデオのグリッドへのフィット方法を変更する

<編集箇所:index.php>

[grid image link setting]の箇所、$flg_obj_fitを変更します。”none”, “small-fit”, “large-fit”のいずれかを指定できます。それぞれ「フィットしない(サイズ無調整)」「小さめのグリッドにフィット」「大きめのグリッドにフィット」になります。

$flg_obj_fit = 'large-fit';  // none | small-fit | large-fit ... how to fit size of object tag.

メインページでコメント数を表示する

<編集箇所:index.php>

113行目付近のPHP内のコメントを消して元に戻します。

<?php comments_popup_link(); ?>

投稿者名を表示する

<編集箇所:index.php>

次のコードを113行目付近に追加します。

Author: <?php the_author(); ?><br />

サイドバー2(下方領域)のデフォルト表示を消す。

2番目のサイドバー領域に限り、何もウィジェットを設定してない場合にデフォルトの内容物を設定しています。これを「何もないときは何も出さない」ようにします。

<編集箇所:sidebar-2.php>

ifブロックの中身(中略の部分)をすべて削除するか、あるいは

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
(中略 ここを削除)
<?php endif; ?>

代わりにifブロックの中をさらにif(false)で囲います。

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
<?php if (false) : ?>
(中略)
<?php endif; ?>
<?php endif; ?>

コメントはまだありません

コメントフォームは現在閉鎖中です。

カスタマイズをする上での参考情報です。
以下、Tanzakuバージョン1.1、WPバージョン2.9 を元に解説します。

*The trouble of One post was corrected.
*投稿数が1つの場合、内容が反映されない不具合を修正しました。

Details »

Tanzaku v1.1解説

sample_290

Title 1

Vimeo

It’s necessary to have more people visit Miyakejima Island as tourists. If that’s not achieved I believe the motorcycle festival will not be able to continue for the long-term. The other day before the event’s opening I climbed the island’s Oyama Mountain with motorcycle experts and asked them about the requirements needed to hold a motocross race. I was told that the mountain had very suitable conditions and that a very exciting race could be held there; this information in turn provided me with confidence. We now hope to put together some prize money, bring in a lot of racers, and turn this into an event that attracts many visitors to the island. This is definitely an event that we’ll make happen; if we don’t, we’ll be losing a great opportunity to revive Miyakejima Island. Look forward to it. This will be a wonderful event in which spectators can watch a very thrilling motocross race held within the island’s expansive, beautiful, and very mystical natural environment.

Title 2

The Tokyo Metropolitan Government (TMG) has conducted environmentally friendly procurement according to the TMG Policy for Green Procurement Promotion, and campaigned to reduce strain on the environment arising from day-to-day work operations.

In an effort to promote the use of renewable energies, TMG has designated “electricity” as an item subject to green procurement, and mandated that large metropolitan facilities that consume more than a set amount of power arrange electricity procurement with consideration to global warming.

As the first step, in November, the Edo Tokyo Museum will become the nation’s first public facility to make “Green Procurement” of electricity.

Title 3

Ohshima is a volcano island, 120km south of the mainland Japan, and could be reached from Tokyo in about half an hour flight. The zoo was opened by a steamship company, and transferred to Tokyo City in 1935. It exhibits Japanese cranes, Japanese serows, white-tailed sea-eagle, Japanese wood pigeons as well as Aldabra giant tortoises and Hawaiian geese.

Title 5

Inokashira Park Zoo is located in a quiet and distinctive suburb of Tokyo. It exhibits a variety of Japanese species and contributes to the conservation and breeding of Japanese squirrels, mandarin ducks, and swans. The park also comprises a pond, a botanical garden and Seibo Kitamura (Japanese sculptor) Museum. The park’s lush verdure offers a relaxing atmosphere for any visitors.

Title 6

Please enjoy viewing realistic and dramatic displays of freshwater and marine life not only from Tokyo, but also from around the world, even from the Antarctic. In the huge 2,200-ton tank, you can enjoy watching bluefin tuna darting swiftly around. The aquarium also exhibits sea birds including penguins, and giant kelp from California, US. The facility sits on the beach of Tokyo Bay and could be reached in half an hour by train from Tokyo station.

Title 7

At Tama Zoo, animals are displayed under naturalistic and spectacular habitats set up in its vast land of 52 ha (129 acres) in Hino City, one hour from central Tokyo by train. It exhibits Japanese animals such as sika deer, Yezo brown bears, and Japanese macaques, as well as animals from all over the world, such as African elephants, koalas, Indian rhinoceroses and orang-utans. The Lion Bus offers you a ride out among the lions.

Title 8

Established in 1882, Ueno Zoo is the oldest zoo in Japan. It has grown over the years, expanded its area, and been a forerunner in the Japanese zoo world. Located amid the downtown Tokyo, Ueno Zoo not only provides recreation, but also plays an essential role in wildlife conservation and public education. In an effort to breed endangered species, the zoo has completed the “Gorilla Woods” and “Tiger Forests.”

Title 9

The Tokyo Metropolitan Art Museum,founded in 1926,has been home to exhibitions of a wide variety of Japanese art organizations for over seventy years.
 After the renovation of its building in 1975,special exhibitions planned by the curators were held in addition to those exhibitions of contemporary Japanese artists’groups in the rental galleries. The museum also provided art lectures and workshops,with the open use of its art library to the public.
  The museum now holds two kinds of exhibitions;one which is mentioned above,in the rental galleries,by contemporary artists whose works include oil paintings,traditional-style Japanese paintings,sculptures,crafts,graphic designs, calligraphy,etc
  The other is special exhibitions organized in cooperation with newspaper and TV companies in the Museum Gallery.

Title 10

Looking at past examples of public works projects such as the Isahaya Bay land reclamation and Nagaragawa River estuary weir, we can see that the government has spent much time engaged in rather pointless activities. Though such examples certainly do exist, I believe that in the case of Yamba Dam, this is a public project essential for the capital region, the nation’s most populous area.

Due to opposition by the six governors of Chiba, Gunma, Ibaragi, Saitama, Tochigi prefectures and Tokyo, the central government has said that it will conduct a thorough study of the project once more. During our meeting with the minister, Governor Kiyoshi Ueda of Saitama asked a very astute question: “If you are now going to conduct a thorough study of this project again, doesn’t this mean that not much of a study was conducted when the party’s manifesto was compiled?” I, too, agree with what Governor Ueda is saying. I believe that reviewing this project is very appropriate action, and I have considerable interest in the results of the study.

Title 11

TMG Bureau of Waterworks has commenced the construction of Japan’s first megawatt-class solar power generation facility (1,200kW) at the Asaka Waterworks.  The facility, scheduled to commence operations in FY2005, will be the largest of its kind in Japan and among the largest in the world.  The construction involves building a covering over a reservoir to prevent foreign matter entering the filtration pond, placed at the final processing stage of the waterworks, and installing solar panels on the covering.  This way, we can ensure a higher level of safety in tap water, while reducing environmental strain through the use of natural energies, and cutting costs through energy conservation at the same time.

The Bureau will gradually install solar power generation facilities at a total of eight waterworks plants (with combined power generation capacity of approx. 5,200kW) over a period of four years from this fiscal year through to FY2006.  The Kanamachi Waterworks (1,120kW) and Higashi Murayama Waterworks (1,050kW) will both obtain mega-watt power generation capacities.

Title 12

Mikura Island is one of the few places in Japan with an unspoiled natural environment, and it attracts an increasing number of tourists each year. This environment is a valuable asset, and in order to pass it on to future generations and to help visitors enjoy it to the full, on January 19, 2004, the TMG and Mikurajima Island inked an agreement on the appropriate use of environmental conservation areas on the island. The agreement lays out rules for enjoying the nature of the island, and under the agreement “eco-tourism” operations on the island will start in April.

Mikura Island is roughly circular, with a circumference of approx. 16 kilometers. It lies around 200 kilometers south of Tokyo, and has a population of 282. Natural features of the island include:

Title 13

The Liaison Council of Tokyo Metropolitan Government and the Municipalities Surrounding Yokota Air Base lodged a request today for action over the noise pollution suffered by residents near the base. The council delivered letters in person Commander 374th Airlift Wing Col. Mark Schissler of Yokota US Air Base; Katsumi Maita, the Director of Tokyo Defense Facilities Administration Bureau; and Hiroshi Matada, Director of Yokota Defense Facilities Administration Office. The Council is chaired by the Governor of Tokyo, and the Deputy Chairman is the Mayor of Musashi Murayama City.

The letters which were delivered are as follows:

Title 14