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.

トップページのスタイリング

ここまではループとそのトップページとの関わりを見てきた。ではいよいよ、いくつかのCSSと共にすべてを一つにまとめて、このテーマの体裁を整えよう。

最初のステップは各投稿記事の間に空間を持たせることだ。今のところ一つの長いテキストが切れ目無く表示されている。各投稿記事にはCSSの「post」クラスが与えられているのでこのスタイリングは簡単だ:

.post
{
margin-bottom: 2.2em;
}

このようになる:

すばらしい。では、スタイルを追加しよう:

.post
{
margin-bottom: 25px;
color: #4A2C00;
padding-left: 5px;font-size: 1.1em;
}h2
{
font-size: 1.6em;

border-bottom: 1px solid #e8c38b;
}

h2 a:hover, h2 a:visited, h2 a
{
text-decoration: none;

color: #bd492a;
}

.entry
{
margin-top: 10px;
margin-bottom: 15px;

}

.postmetadata
{
padding: 2px;
font-size: 0.8em;
border-top: 1px solid #FADA96;

}

.postmetadata a
{
color: #4a2c00;
}

それほど多くのコードがあるわけではない。
フォントサイズとボーダーと共にマージンを変更した。変更後を見てみると完成にだいぶん近づいているのが分かるだろう:

コンテンツのスタイリング

はっきりと分からないかもしれないが、上の画像の投稿記事にはコンテンツに対するスタイリングが欠けている。パラグラフ間やリスト間のスペースなどの基本的なフォーマットだ。

まずはパラグラフ間のスペースに取り組む:

.post p
{
line-height: 1.4em;
margin-bottom: 1em;}

これはブログの読みやすさに大きく影響する:

残りのスタイルを一緒にし、今のKubrickのstyle.cssからいくつか取り除き、その他をこのテーマに合うように変更した。

何を変更したのか分かるようにスタイル無しの文章を次に挙げる:

これは全く素のままだ。では、スタイルを追加しよう:

blockquote
{
margin: 1em 1.5em;
padding: 1em 1.5em;border: 1px solid #FADA96;
background: #FCF1E2 url(images/blockquote.png) no-repeat scroll top left;}

.post li
{
margin-left: 20px;
}

.post ul
{

list-style-image: url(images/listitem.png);
list-style-type: bullet;
margin-bottom: 10px;
}

acronym, abbr, span.caps
{
cursor: help;
}

acronym, abbr
{
border-bottom: 1px dashed #999;

}

blockquote cite
{
margin: 5px 0 0;
display: block;

}

.center
{
text-align: center;
}

a img
{
border: none;

}

h3
{
margin-top: 1.5em;
font-size: 1.4em;

}

h4
{
margin-top: 1.2em;
font-size: 1.2em;

}

h5
{
margin-top: 1em;
font-size: 1em;
}

.post a

{
color: #bd492a;
}

このようになる:

基本的にリストのマージンはサイドバーのものと同じで、それを再適用している(CSSのサイズを減らすために再利用することもできるがここではしていない)。さまざまなレベルのヘッダーを定義したのですべてのブラウザで同じサイズに見えるし、blockquote要素には背景イメージと色スキームを設定した。

This entry was posted in WordPress. Bookmark the permalink.

5 Responses to WordPress テーマの詳説:第四章

  1. Pingback: Wordpress カスタマイズ・・・のための 「関数」 | 頭脳外部メモリー 「独学で趣味を満喫」

  2. WordPress大ファン says:

    突然の書き込みすいません。
    実は、以下の点に関して教えていただければと思います。
    WordPressで、各投稿の「コメント」を見ると、「古いコメント」が一番最初に来て、「新しいコメント」が一番最後に来ます。
    これを逆にするには、comments.phpにある以下のものをどう修正すればいいのでしょうか。
    教えていただければ幸いです。

  3. lsp109 says:

    今頃ですが。。。とても参考になりました。
    ありがとうございます。

  4. Pingback: WordPress テーマ作成(2) – 塵芥空間

コメントを残す

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

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