<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Office L &#187; WP Theme Hacks</title>
	<atom:link href="http://officel.biz/wp-theme-hack/feed" rel="self" type="application/rss+xml" />
	<link>http://officel.biz</link>
	<description>IT系なんでも屋</description>
	<lastBuildDate>Wed, 17 Feb 2010 15:30:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officel.biz/wp-theme-hack/feed" />
		<item>
		<title>[WPTH vol.02] 携帯３キャリアに対応した header.php のメモ</title>
		<link>http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol02.htm</link>
		<comments>http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol02.htm#comments</comments>
		<pubDate>Wed, 07 May 2008 00:00:05 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[WP Theme Hacks]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://officel.biz/?p=30</guid>
		<description><![CDATA[WordPress の Theme のうち、header.php で使えそうなもののメモ第二弾。携帯電話国内３キャリア（docomo,au,SoftBank）とPC用にヘッダの出力を変更することでCSS対応にする。]]></description>
			<content:encoded><![CDATA[				<p>日本国内の携帯電話３キャリア<ins>(ただし3Gのみ)</ins>に対応した WordPress Theme 記述の手抜き版。既存の携帯プラグインは多機能なため、自分でテーマを管理できる場合や、要求精度が低い場合には冗長すぎるので、プラグインなしでPC用と同一テンプレートで処理するには？ということで書いてみた。</p>
				<p>アウトプットはPC版の文字コードに依存する。ME では検証していない（たぶん問題なく動く）。UTF-8 以外の文字コードで動作確認をしていないが、変更する場合は記述も変えないといけないことに注意。動作確認は、テストサイト<a href="http://kanji.uows.jp/">漢字読めるかな？</a>（QRから携帯で確認可能）にて行っている。各々の環境で確認してみて、不具合などあれば教えていただけると非常にありがたい。</p>
				<pre><code>
&lt;?php
	$agent = $_SERVER['HTTP_USER_AGENT'];
	$isPC  = 1;
	if(ereg("^DoCoMo", $agent)){
		header("Content-Type:application/xhtml+xml");
		$isPC  = 0;
		$xml=&lt;&lt;&lt;EOF
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//i-mode group (ja)//DTD XHTML i-XHTML(Locale/Ver.=ja/1.0) 1.0//EN" "i-xhtml_4ja_10.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
EOF;
	}else if(ereg("^J-PHONE|^Vodafone|^SoftBank", $agent)){
		$isPC  = 0;
		$xml=&lt;&lt;&lt;EOF
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"&gt;
EOF;
	}else if(ereg("^UP.Browser|^KDDI", $agent)){
		$isPC  = 0;
		$xml=&lt;&lt;&lt;EOF
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"&gt;
EOF;
	}else{
		$xml=&lt;&lt;&lt;EOF
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"&gt;
EOF;
	}
	echo $xml;
?&gt;
&lt;head&gt;

中略

&lt;?php if ( $isPC != 1 ){ ?&gt;
&lt;style type=text/css"&gt;
&lt;!--
// 携帯用にCSSを記述。利用可能範囲に注意。
//--&gt;
&lt;/style&gt;
&lt;?php } ?&gt;

</code></pre>
				<p>漢字読めるかな？の環境まわりは次のとおり。</p>
				<ul>
				<li>WordPress 日本語版 2.5</li>
				<li>DB は MySQL 5</li>
				<li>文字コードはUTF-8</li>
				<li>docomo は 705,905 など多数の機種で確認（自前ではないので正確な表示確認はしていない）</li>
				<li>au は W43SA INFOBAR2 などの機種で確認</li>
				<li>SoftBank は、911SH 920T などの機種で確認</li>
				</ul>
]]></content:encoded>
			<wfw:commentRss>http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol02.htm/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol02.htm" />
	</item>
		<item>
		<title>[WPTH vol.01] header.php でよく使う書き方メモ</title>
		<link>http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol01.htm</link>
		<comments>http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol01.htm#comments</comments>
		<pubDate>Mon, 05 May 2008 15:47:41 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[WP Theme Hacks]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://officel.biz/?p=29</guid>
		<description><![CDATA[WordPress の Theme のうち、header.php で使えそうなもののメモ第一弾。]]></description>
			<content:encoded><![CDATA[				<p>WordPress の Theme ファイルのうち、header.php でよく使う書き方を備忘的にメモ。まだ検証途中であり、後々まとめを作成する予定。将来的に汎用的に使いまわせるようにできるといいと思う。</p>
				<h3>title</h3>
				<pre><code>
&lt;title&gt;&lt;?php
    wp_title(' | ',true,'right');
    bloginfo(’name’);
    if(is_home()){
        echo ' | ';
        bloginfo('description');
    }
?&gt;&lt;/title&gt;
</code>
</pre>
				<h3>description</h3>
				<pre><code>
&lt;?php if ( $description = get_bloginfo('description') ) { ?&gt;&lt;meta name="description" content="&lt;?php bloginfo('description'); ?&gt;" /&gt;&lt;?php } ?&gt;
</code></pre>
				<h3>CSS</h3>
				<pre><code>
&lt;link rel="stylesheet" href="&lt;?php bloginfo('stylesheet_url'); ?&gt;" type="text/css" media="screen" /&gt;
&lt;link rel="stylesheet" href="&lt;?php bloginfo('template_url'); ?&gt;/print.css" type="text/css" media="print" /&gt;
</code></pre>
				<h3>link (ナビゲーション) home へのリンク用</h3>
				<pre><code>
&lt;?php if (!is_home()) { ?&gt;&lt;link rel="start" href="&lt;?php bloginfo('home'); ?&gt;" title="&lt;?php bloginfo('name'); ?&gt; Home" /&gt;&lt;?php } ?&gt;
</code></pre>
				<h3>link (ナビゲーション) アーカイブへのリンク用</h3>
				<pre><code>
&lt;?php wp_get_archives('type=monthly&#038;format=link'); ?&gt;
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol01.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officel.biz/wordpress/wordpress-theme-hack-on-headerphp-vol01.htm" />
	</item>
	</channel>
</rss>
