2007年7月7日

新しいサイト”わーどぷれすっ!”をオープンしました。

今後はWordPress関連の話題は全部このサイトに投稿していきます。プラグイン一覧もこの新サイトに移しましたので、ドウゾよろしくお願いします。

WordPress テーマの詳説:第二章

Registry First Aid will find these invalid entries and remove them from your registry. With Registry First Aid, your Windows registry will be always clean and correct, helping your programs load faster and speeding up your computer. Fast, easy to use, PC speed testing and benchmarking. PassMark PerformanceTest allows you to objectively benchmark a x blades keygen PC using a variety of different speed tests and compare the results to other computers. Twenty-eight standard benchmark tests are available in six test suites plus there are seven advanced testing windows for custom benchmarking. In addition to the standard tests, there are 7 summary results plus the overall PassMark Rating result. The benchmark results are xilisoft keygen presented as easy to read bar charts so that you dont need to spend hours studying the number to know the result. Timing for the tests is done using high resolution timers, which are accurate to approximately 1 millionth of a second on most PCs. Create professional-quality advertising, sophisticated print designs and electronic documents with PagePlus sims 2 keygen X5, the best-in-class desktop publisher.

ステップ3 ヘッダー

私たちのデザインは完全に確定し、どんなブラウザでも表示できる立派な物になったはずだ。そこで CSS 関連はひとまず終わりにしてヘッダーに注目してみよう。

ヘッダーは自分なりの独創性をほぼ完全に演出することのできる数少ない場所の一つだ。写真、広告、フラッシュアニメなど、好きな物を何でも置くことができる。覚えておいてほしいのだが、ヘッダーというのはあなたのサイトを訪れた人が最初に目にする場所であり、あなたのブログから注意をそらすのではなく引きつけることが重要であるということだ。

では header.php 内のコードを見てみよう。

<!DOCTYPE HTML PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head profile=“http://gmpg.org/xfn/11″>
<meta HTTP-equiv=“Content-Type” content=“<?php bloginfo(’html_type’); ?>; charset=<?php bloginfo(’charset’); ?>” /><title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> <?php } wp_title(); ?></title>
<meta name=“generator” content=“WordPress <?php bloginfo(’version’); ?>” /> <!– leave this for stats –>

<link rel=“stylesheet” xhref=“<?php bloginfo(’stylesheet_url’); ?>” type=“text/css” media=“screen” />

<link rel=“alternate” type=“application/rss+XML” title=“RSS 2.0″ xhref=“<?php bloginfo(’rss2_url’); ?>” />

<link rel=“alternate” type=“text/xml” title=“RSS .92″ xhref=“<?php bloginfo(’rss_url’); ?>” />

<link rel=“alternate” type=“application/atom+xml” title=“Atom 0.3″ xhref=“<?php bloginfo(’atom_url’); ?>” />

<link rel=“pingback” xhref=“<?php bloginfo(’pingback_url’); ?>” />

<?php wp_get_archives(‘type=monthly&format=link’); ?>

<?php wp_head(); ?>
</head>

<body>

<div id=“page”>
<div id=“header”>
<div id=“headerimg”>
<h1><a xhref=“<?php echo get_settings(’home’); ?>”><?php bloginfo(‘name’); ?></a></h1><div class=“description”><?php bloginfo(‘description’); ?></div>
</div>
</div>

<hr />

最初の2行は XHTML の基本情報だ。ここはそのままにして分かりにくい箇所を見ていこう。

ここにあるのは:

  • ヘッダー情報セクション(<heda>要素内のすべて)
  • page div の始まり
  • header div

<heda> セクション内のほとんどのコードは無視してかまわない。ここでは RSS と Atom フィードを定義していて、変更する必要はない。スタイルシートへのリンクもここにある。

<link rel=“stylesheet” xhref=“<?php bloginfo(’stylesheet_url’); ?>” type=“text/css” media=“screen”/>

WordPress が bloginfo (‘stylesheet_url’) を参照して正確なロケーションをここに入れるので、私たちがパスを書き込む必要はない。

wp_head の呼び出しによりプラグインが独自のヘッダーデータを追加することができる。ここもそのままでよい。変更したほうがいいかもしれない唯一の項目はタイトルの定義だ:

<title><?php bloginfo(‘name’); ?> <?php if ( is_single() ) { ?> <?php } wp_title(); ?></title>

このタイトルはブラウザ・ウインドウのウインドウバーに表示されるものだ。

ここではタイトルは自分のブログ名 – bloginfo (‘name’) – で、 WordPress の管理画面で設定することができる。この後にあまり役に立ちそうにない風変わりなコードがいくつか続くが、大事なのは次の部分だ。

wp_title ()

これは閲覧中のページのタイトルを表示する。デフォルトでは WordPress はタイトルと他を分けるのに raquo 記号 ‘»’ を使用している。これを次のように変更してみよう:

wp_title (‘-’)

ここではセパレーターとしてダッシュ(横棒)を使用してみた。また、タイトルを自分の好きなように変更することもできる:

<title><?php bloginfo (‘name’); ?> はジョンのひねくれた想像の産物</title>

このタイトルは今のところ良さそうなのでこのままにしておく。

header.php のその他の部分はより重要だ:

<div id=“page”><div id=“header”>
<div id=“headerimg”>
<h1><a xhref=“<?php echo get_settings(’home’); ?>”><?php bloginfo(‘name’); ?></a></h1>

<div class=“description”><?php bloginfo(‘description’); ?></div>
</div>
</div>
<hr />

ここで div ‘page’ が始まり、footer.php でこのタグが閉じられる。この page 要素はすべて – ヘッダー、コンテンツ、サイドバー、フッター – を囲んでいる。

この page 要素のすぐ後ろに別の div – ‘header’ – があり、そのまたすぐ後ろに ‘headerimg’ が続く。必ずしもこの構造を使用する必要はないのだが、このガイドのために残しておくことにする。ここには画像その他の項目を入れることができる。

This entry was posted in WordPress, WP ヒント. Bookmark the permalink.

One Response to WordPress テーマの詳説:第二章

  1. Pingback: WordPress導入レポ・テーマ | 12-09.net

コメントを残す

メールアドレスが公開されることはありません。

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>