[WPTH vol.01] header.php でよく使う書き方メモ

WordPress の Theme ファイルのうち、header.php でよく使う書き方を備忘的にメモ。まだ検証途中であり、後々まとめを作成する予定。将来的に汎用的に使いまわせるようにできるといいと思う。

title


<title><?php
    wp_title(' | ',true,'right');
    bloginfo(’name’);
    if(is_home()){
        echo ' | ';
        bloginfo('description');
    }
?></title>

description


<?php if ( $description = get_bloginfo('description') ) { ?><meta name="description" content="<?php bloginfo('description'); ?>" /><?php } ?>

CSS


<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/print.css" type="text/css" media="print" />

link (ナビゲーション) home へのリンク用


<?php if (!is_home()) { ?><link rel="start" href="<?php bloginfo('home'); ?>" title="<?php bloginfo('name'); ?> Home" /><?php } ?>

link (ナビゲーション) アーカイブへのリンク用


<?php wp_get_archives('type=monthly&format=link'); ?>
This entry was posted on 火曜日, 5 月 6th, 2008 and is filed under WP Theme Hacks, wordpress. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “[WPTH vol.01] header.php でよく使う書き方メモ”

  1. admin on 5 月 6th, 2008 at 12:52 AM

    細々とアウトプット作っていかないとどうしようもなくなってきたので、未完ネタながら公開開始。
    技術的な情報交換のできる人募集中です。

Leave a Reply

Sponsors...No,It's a Joke:p

ǂ߂邩ȁH Office L on Twitter

site search

 

category