<?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/"
	>

<channel>
	<title>Serendip &#187; wordpress</title>
	<atom:link href="http://www.serendip.ws/archives/tag/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.serendip.ws</link>
	<description>Webデザイン・プログラミング</description>
	<lastBuildDate>Fri, 10 Feb 2012 05:33:58 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>WordPress で、テンプレートタグ the_excerpt による p タグの自動挿入を防ぐ</title>
		<link>http://www.serendip.ws/archives/5119</link>
		<comments>http://www.serendip.ws/archives/5119#comments</comments>
		<pubDate>Mon, 20 Sep 2010 23:54:29 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=5119</guid>
		<description><![CDATA[WordPress のテンプレートタグ the_excerpt で生成される内容が自動的に &#60;p&#62; タグで囲まれるのを防ぐ方法のメモ。 テーマフォルダ内に functions.php ファイルを作成し、以下の [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress のテンプレートタグ <code>the_excerpt</code> で生成される内容が自動的に &lt;p&gt; タグで囲まれるのを防ぐ方法のメモ。</p>
<p>テーマフォルダ内に functions.php ファイルを作成し、以下の記述を追加する。</p>
<pre><span class="Special">&lt;?php</span>
    <span class="Comment">// 省略...</span>
    remove_filter<span class="Special">(</span>'<span class="Constant">the_excerpt</span>', '<span class="Constant">wpautop</span>'<span class="Special">)</span>;
    <span class="Comment">// 省略...</span>
<span class="Special">?&gt;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/5119/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress で記事に mixi チェックボタンを設置する</title>
		<link>http://www.serendip.ws/archives/5112</link>
		<comments>http://www.serendip.ws/archives/5112#comments</comments>
		<pubDate>Sat, 11 Sep 2010 03:43:49 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=5112</guid>
		<description><![CDATA[mixi チェックとはサイトの記事をコメント付きでマイミク等と共有できるサービスらしい。 ページ内に設置された mixi チェックボタンをクリックしてチェックリストにそのページを登録していく。 この、mixi チェックボ [...]]]></description>
			<content:encoded><![CDATA[<p>mixi チェックとはサイトの記事をコメント付きでマイミク等と共有できるサービスらしい。<br />
ページ内に設置された mixi チェックボタンをクリックしてチェックリストにそのページを登録していく。</p>
<p>この、mixi チェックボタンを WordPress テンプレートを編集して、記事内に設置する方法をメモしておく。</p>
<h3>mixi チェックキーの取得</h3>
<p><a href="http://developer.mixi.co.jp/" class="out" rel="external">mixi Developer Center (ミクシィ デベロッパーセンター)</a> ページから『Developer Dashboard』にログインして、『mixi Plugin』ページに移動する。</p>
<p>『新規サービス追加』から『サービス名』（登録サービスの一覧に表示される名前）、『サービスのURL』（ボタンを設置するサイトのトップページURLなど）、『URL許可リスト』（チェック対象ページ内の画像などのデータ取得などを許可するURLのパターン?）、『定型文』（チェックリストのタイトルなどに表示される）を入力して、利用規約に同意するにチェックを入れて『入力内容を確認する』ボタンをクリックする。</p>
<p>確認画面から『作成する』ボタンをクリックすると登録が完了し、『チェックキー』が発行される。</p>
<p>サービス登録を行ったら、<a href="http://developer.mixi.co.jp/connect/mixi_plugin/mixi_check/spec_mixi_check" class="out" rel="external">技術仕様 << mixi Developer Center (ミクシィ デベロッパーセンター)</a> の内容に従って WordPress テンプレートを修正していく。</p>
<h3>mixi チェックボタンの設置</h3>
<p>個別記事テンプレート（single.php）内の適当な場所に mixi チェックボタンのタグを挿入する。</p>
<dl class="entry-list-style">
<dt><code>href</code>（必須）</dt>
<dd><code>http://mixi.jp/share.pl</code></dd>
<dt><code>class</code>（必須）</dt>
<dd><code>mixi-check-button</code></dd>
<dt><code>data-key</code>（必須）</dt>
<dd>発行された mixi チェックキー</dd>
<dt><code>data-url</code></dt>
<dd>記事のURL<br />
    <code>the_permalink()</code> で取得する</dd>
<dt><code>data-button</code></dt>
<dd><code>button-1</code> から <code>button-5</code> までの 5 パターンのボタン画像がある。<br />
    指定しない場合はテキストリンクが表示される。</dd>
</dl>
<h4>コード例</h4>
<pre><span class="Identifier">&lt;</span><span class="Statement">a</span><span class="Identifier"> </span><span class="Type">href</span><span class="Identifier">=</span><span class="Constant">&quot;http://mixi.jp/share.pl&quot;</span><span class="Identifier"> </span><span class="Type">class</span><span class="Identifier">=</span><span class="Constant">&quot;mixi-check-button&quot;</span><span class="Identifier"> </span><span class="Type">data</span><span class="Identifier">-key=</span><span class="Constant">&quot;mixi チェックキー&quot;</span><span class="Identifier"> </span><span class="Type">data</span><span class="Identifier">-</span><span class="Type">url</span><span class="Identifier">=</span><span class="Constant">&quot;</span><span class="Special">&lt;?php</span> the_permalink<span class="Special">()</span>; <span class="Special">?&gt;</span><span class="Constant">&quot;</span><span class="Identifier"> </span><span class="Type">data</span><span class="Identifier">-button=</span><span class="Constant">&quot;button-1&quot;</span><span class="Identifier">&gt;</span><span class="Underlined">Check</span><span class="Identifier">&lt;/</span><span class="Statement">a</span><span class="Identifier">&gt;</span>
<span class="Identifier">&lt;</span><span class="Statement">script</span><span class="Identifier"> </span><span class="Type">type</span><span class="Identifier">=</span><span class="Constant">&quot;text/javascript&quot;</span><span class="Identifier"> </span><span class="Type">src</span><span class="Identifier">=</span><span class="Constant">&quot;http://static.mixi.jp/js/share.js&quot;</span><span class="Identifier">&gt;</span><span class="Identifier">&lt;/</span><span class="Statement">script</span><span class="Identifier">&gt;</span>
</pre>
<h3>名前空間の追加</h3>
<p>サイトの <code>html</code> 要素に以下の名前空間宣言を追加する。</p>
<pre>mlns:og=&quot;http://ogp.me/ns#&quot;
xmlns:mixi=&quot;http://mixi-platform.com/ns#&quot;
</pre>
<h4>コード例</h4>
<pre><span class="Identifier">&lt;</span><span class="Statement">html</span><span class="Identifier"> </span><span class="Type">lang</span><span class="Identifier">=</span><span class="Constant">&quot;ja&quot;</span><span class="Identifier"> xml:</span><span class="Type">lang</span><span class="Identifier">=</span><span class="Constant">&quot;ja&quot;</span><span class="Identifier"> xmlns=</span><span class="Constant">&quot;http://www.w3.org/1999/xhtml&quot;</span>
<span class="Identifier">    xmlns:og=</span><span class="Constant">&quot;http://ogp.me/ns#&quot;</span><span class="Identifier"> xmlns:mixi=</span><span class="Constant">&quot;http://mixi-platform.com/ns#&quot;</span><span class="Identifier">&gt;</span>
</pre>
<h3>チェックのタイトル、本文を指定する</h3>
<p><code>html</code> の <code>head</code> 内に mixi チェックのタイトルと本文を指定する <code>meta</code> タグを追加する。<br />
本文は mixi チェックの『続きを見る』リンクから見ることができる。</p>
<pre>&lt;meta property=&quot;og:title&quot; content=&quot;タイトル&quot; /&gt;
&lt;meta property=&quot;og:description&quot; content=&quot;本文&quot; /&gt;
</pre>
<h4>コード例</h4>
<p>Single ページでのみ <code>meta</code> タグを入れるようにした。</p>
<pre><span class="Special">&lt;?php</span> <span class="Statement">if</span> <span class="Special">(</span>is_single<span class="Special">())</span> <span class="Statement">:</span> <span class="Statement">if</span> <span class="Special">(</span>have_posts<span class="Special">())</span> <span class="Statement">:</span> <span class="Statement">while</span> <span class="Special">(</span>have_posts<span class="Special">())</span> <span class="Statement">:</span> the_post<span class="Special">()</span>; <span class="Special">?&gt;</span>
    <span class="Identifier">&lt;</span><span class="Statement">meta</span><span class="Identifier"> property=</span><span class="Constant">&quot;og:title&quot;</span><span class="Identifier"> </span><span class="Type">content</span><span class="Identifier">=</span><span class="Constant">&quot;</span><span class="Special">&lt;?php</span> the_title<span class="Special">()</span>; <span class="Special">?&gt;</span><span class="Constant"> : </span><span class="Special">&lt;?php</span> bloginfo<span class="Special">(</span>'<span class="Constant">name</span>'<span class="Special">)</span>; <span class="Special">?&gt;</span><span class="Constant"> - </span><span class="Special">&lt;?php</span> bloginfo<span class="Special">(</span>'<span class="Constant">description</span>'<span class="Special">)</span>; <span class="Special">?&gt;</span><span class="Constant">&quot;</span><span class="Identifier"> /&gt;</span>
    <span class="Identifier">&lt;</span><span class="Statement">meta</span><span class="Identifier"> property=</span><span class="Constant">&quot;og:description&quot;</span><span class="Identifier"> </span><span class="Type">content</span><span class="Identifier">=</span><span class="Constant">&quot;</span><span class="Special">&lt;?php</span> the_excerpt<span class="Special">()</span>; <span class="Special">?&gt;</span><span class="Constant">&quot;</span><span class="Identifier"> /&gt;</span>
<span class="Special">&lt;?php</span> <span class="Statement">endwhile</span>; <span class="Statement">endif</span>; <span class="Statement">endif</span>; <span class="Special">?&gt;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/5112/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress データベースの自動バックアップ (WP-DB-Backup)</title>
		<link>http://www.serendip.ws/archives/3014</link>
		<comments>http://www.serendip.ws/archives/3014#comments</comments>
		<pubDate>Mon, 14 Sep 2009 13:25:25 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=3014</guid>
		<description><![CDATA[WordPress のデータベースを自動でバックアップしてくれるプラグイン WP-DB-Backup をインストール・設定する。 ダウンロードしてアーカイブを展開したフォルダを wp-content/plugins/ デ [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress のデータベースを自動でバックアップしてくれるプラグイン <a href="http://wordpress.org/extend/plugins/wp-db-backup/" class="out">WP-DB-Backup</a> をインストール・設定する。</p>
<p>ダウンロードしてアーカイブを展開したフォルダを wp-content/plugins/ ディレクトリに配置して、『プラグインの管理』ページから『使用する』をクリックして、使用開始する。<br />
『ツール』の『バックアップ』をクリックするとディレクトリが無いとのエラーが出るので、wp-content/ ディレクトリに指定されたディレクトリ(backup-<var>?????</var>)を作成し、書き込み可能パーミッションに変更する。</p>
<p>あとは、バックアップ設定でバックアップファイルの扱いをしていしたり、定期バックアップの設定などをして完了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/3014/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress での自動アップグレード (xrea サーバ)</title>
		<link>http://www.serendip.ws/archives/3010</link>
		<comments>http://www.serendip.ws/archives/3010#comments</comments>
		<pubDate>Sun, 13 Sep 2009 11:44:33 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=3010</guid>
		<description><![CDATA[xrea サーバで WordPress のプラグインの自動アップグレードを行う方法について。 初期状態では『ディレクトリが見つかりません』と表示されてエラーになってしまうので、wp-config.php に以下の記述を追 [...]]]></description>
			<content:encoded><![CDATA[<p>xrea サーバで WordPress のプラグインの自動アップグレードを行う方法について。</p>
<p>初期状態では『ディレクトリが見つかりません』と表示されてエラーになってしまうので、wp-config.php に以下の記述を追加しておく。</p>
<pre><span class="Identifier">define</span><span class="Special">(</span>'<span class="Constant">FTP_BASE</span>', '<span class="Constant">/vertual/<var>account</var>/public_html/wordpress/</span>'<span class="Special">)</span>;
<span class="Identifier">define</span><span class="Special">(</span>'<span class="Constant">FTP_CONTENT_DIR</span>', '<span class="Constant">/vertual/<var>account</var>/public_html/wordpress/wp-content/</span>'<span class="Special">)</span>;
<span class="Identifier">define</span><span class="Special">(</span>'<span class="Constant">FTP_PLUGIN_DIR</span>', '<span class="Constant">/vertual/<var>account</var>/public_html/wordpress/wp-content/plugins/</span>'<span class="Special">)</span>;
</pre>
<p>また、xrea サーバは PHP がセーフモードで動作しているので、以下の記述を追加した .htaccess ファイルを wp-admin/ ディレクトリに配置する。</p>
<pre><span class="Statement">&lt;Files</span><span class="Constant"> upload.php</span><span class="Statement">&gt;</span>
<span class="Identifier">AddHandler</span> application/x-httpd-phpcgi .php
<span class="Statement">&lt;/Files&gt;</span>

<span class="Statement">&lt;Files</span><span class="Constant"> update.php</span><span class="Statement">&gt;</span>
<span class="Identifier">AddHandler</span> application/x-httpd-phpcgi .php
<span class="Statement">&lt;/Files&gt;</span>
</pre>
<p>以上の設定を行い、プラグインの管理ページからアップグレードするプラグインの自動アップグレードリンクをクリックする。<br />
プラグインのアップグレードページの接続情報で、ホスト名に ftp サーバのアドレスを、ユーザー名を FTP ユーザー名を、パスワードにサーバのパスワードを入力し、開始ボタンをクリックすると、アップグレード作業情報が表示されながら進行してゆきアップグレードが完了する。</p>
<h3>その他の .htaccess 設定</h3>
<p>xrea サーバで WordPress のその他のアップグレード・インストール・アップロードのための .htaccess の設定方法は以下の通り。<br />
wp-admin/ ディレクトリの .htaccess に各記述を追加する。</p>
<h4>WordPress コアアップグレード</h4>
<pre><span class="Statement">&lt;Files</span><span class="Constant"> update-core.php</span><span class="Statement">&gt;</span>
<span class="Identifier">AddHandler</span> application/x-httpd-phpcgi .php
<span class="Statement">&lt;/Files&gt;</span>
</pre>
<h4>WordPress ファイルアップロード</h4>
<pre><span class="Statement">&lt;Files</span><span class="Constant"> async-upload.php</span><span class="Statement">&gt;</span>
<span class="Identifier">AddHandler</span> application/x-httpd-phpcgi .php
<span class="Statement">&lt;/Files&gt;</span>
</pre>
<h4>プラグイン自動インストール</h4>
<pre><span class="Statement">&lt;Files</span><span class="Constant"> plugin-install.php</span><span class="Statement">&gt;</span>
<span class="Identifier">AddHandler</span> application/x-httpd-phpcgi .php
<span class="Statement">&lt;/Files&gt;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/3010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress で画像の投稿をする方法</title>
		<link>http://www.serendip.ws/archives/3019</link>
		<comments>http://www.serendip.ws/archives/3019#comments</comments>
		<pubDate>Thu, 10 Sep 2009 09:54:09 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[manual]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=3019</guid>
		<description><![CDATA[『画像を追加』画面の『自分のコンピューターからメディアファイルを追加』から『ファイルを選択』をクリックしてアップロードするファイルを選択する。 小さな画像（サムネイル）をクリックすると大きな画像が表示され]]></description>
			<content:encoded><![CDATA[<p>『画像を追加』画面の『自分のコンピューターからメディアファイルを追加』から『ファイルを選択』をクリックしてアップロードするファイルを選択する。</p>
<p><img src="http://www.serendip.ws/wordpress/wp-content/uploads/wordpress_adding_image_001.png" alt="WordPress 画像投稿方法 Screenshot1" title="WordPress 画像投稿方法 Screenshot1" width="359" height="218" class="size-full wp-image-3020" /></p>
<h3>小さな画像（サムネイル）をクリックすると大きな画像が表示されるタイプ</h3>
<ol>
<li>『タイトル』に画像のタイトルを入力</li>
<li>『リンクURL』に『ファイルのURL』をクリックしてURLを入力(必須)</li>
<li>『配置』でサムネイルが記事のどの位置に表示されるかを指定</li>
<li>『サイズ』で『サムネイル(150&#215;150)』または『中サイズ(???x???)』を指定</li>
<li>『投稿に挿入』をクリックして完了</li>
</ol>
<h3>小さな画像（サムネイル）をクリックすると別のページまたは別のサイトに移動するタイプ</h3>
<ol>
<li>『タイトル』に画像のタイトルを入力</li>
<li>『リンクURL』に移動先のURLを入力(必須)</li>
<li>『配置』でサムネイルが記事のどの位置に表示されるかを指定</li>
<li>『サイズ』で『サムネイル(150&#215;150)』または『中サイズ(???x???)』を指定</li>
<li>『投稿に挿入』をクリックして完了</li>
</ol>
<h3>画像のみを表示するタイプ（リンクは無し）</h3>
<ol>
<li>『タイトル』に画像のタイトルを入力</li>
<li>『リンクURL』にURLが入力されていれば『なし』をクリックして消す</li>
<li>『配置』で画像が記事のどの位置に表示されるかを指定</li>
<li>『サイズ』で希望のサイズを指定</li>
<li>『投稿に挿入』をクリックして完了</li>
</ol>
<p><img src="http://www.serendip.ws/wordpress/wp-content/uploads/wordpress_adding_image_002.png" alt="WordPress 画像投稿方法 Screenshot2" title="WordPress 画像投稿方法 Screenshot2" width="500" height="344" class="size-full wp-image-3021" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/3019/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress でアーカイブリストの表示をカテゴリ別に行う</title>
		<link>http://www.serendip.ws/archives/2969</link>
		<comments>http://www.serendip.ws/archives/2969#comments</comments>
		<pubDate>Mon, 07 Sep 2009 14:40:26 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=2969</guid>
		<description><![CDATA[WordPress のテンプレートタグ wp_get_archives はカテゴリ別にリストを表示できない。 そこで、Archives for a category WordPress plugin を使うと、カテゴリを [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress のテンプレートタグ <code>wp_get_archives</code> はカテゴリ別にリストを表示できない。</p>
<p>そこで、<a href="http://kwebble.com/blog/2007_08_15/archives_for_a_category" class="out">Archives for a category WordPress plugin</a> を使うと、カテゴリを選択・除外したアーカイブリストを表示させることができる。</p>
<h3>インストール・設定</h3>
<ol>
<li>リンク先から zip ファイルをダウンロードする。</li>
<li>zip ファイルを展開して、kwebble_archives_by_cat.php ファイルを WordPress の plugin ディレクトリに配置する。</li>
<li>管理画面の『プラグイン』から『Archives for a category』を『使用する』設定にする。</li>
<li>管理画面の『設定』→『Kwbble』から『Disable canonical URLs.』にチェックを入れて 『Update Options』をクリックして設定を行う。</li>
</ol>
<h3>コード例</h3>
<p>カテゴリ 1,3 を選択し、カテゴリ 2,4 を除外するアーカイブリストを表示する場合。</p>
<pre><span class="Special">&lt;?php</span> wp_get_archives<span class="Special">(</span>'<span class="Constant">cat=1,3&amp;cat=-2,-4</span>'<span class="Special">)</span>; <span class="Special">?&gt;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/2969/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress でヘッダ内のバージョン番号を消す</title>
		<link>http://www.serendip.ws/archives/2976</link>
		<comments>http://www.serendip.ws/archives/2976#comments</comments>
		<pubDate>Sun, 06 Sep 2009 14:03:14 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=2976</guid>
		<description><![CDATA[WordPress のテンプレートタグ wp_head() を使うと、利用している WordPress のバージョン番号が meta タグとして追加される。 そこで、functions.php に以下のコードを記述すると [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress のテンプレートタグ <code>wp_head()</code> を使うと、利用している WordPress のバージョン番号が <code>meta</code> タグとして追加される。<br />
そこで、functions.php に以下のコードを記述するとバージョン番号の表示が行われなくなる。</p>
<pre>remove_action<span class="Special">(</span>'<span class="Constant">wp_head</span>', '<span class="Constant">wp_generator</span>'<span class="Special">)</span>;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/2976/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress で単独投稿ページにカテゴリ名をパンくずリストの中に表示させる</title>
		<link>http://www.serendip.ws/archives/2966</link>
		<comments>http://www.serendip.ws/archives/2966#comments</comments>
		<pubDate>Sat, 05 Sep 2009 14:12:54 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=2966</guid>
		<description><![CDATA[WordPress プラグイン Breadcrumb Navigation XT を使ってパンくずリストを表示させている場合に、デフォルトでは単独投稿ページではホーム直下に記事タイトルがくる。 これを、ホームの次にカテゴ [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress プラグイン <a href="http://sw-guide.de/wordpress/plugins/breadcrumb-nav-xt/" class="out">Breadcrumb Navigation XT</a> を使ってパンくずリストを表示させている場合に、デフォルトでは単独投稿ページではホーム直下に記事タイトルがくる。<br />
これを、ホームの次にカテゴリ名を表示させ、その後に記事タイトルを表示させるには、次のオプションを設定する。</p>
<pre><span class="Statement">$</span><span class="Identifier">mybreadcrumb</span><span class="Type">-&gt;</span>opt<span class="Special">[</span>'<span class="Constant">singleblogpost_category_display</span>'<span class="Special">]</span> <span class="Statement">=</span> <span class="Constant">true</span>;
</pre>
<p>以下のサンプルのように、カテゴリへのリンクが投稿記事タイトルとの間に表示される。</p>
<p><a href="#">ホーム</a> &gt; <var><a href="#">カテゴリ名</a></var> &gt; <var>投稿記事タイトル</var></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/2966/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress で現在のページの子ページのリストを表示する</title>
		<link>http://www.serendip.ws/archives/2947</link>
		<comments>http://www.serendip.ws/archives/2947#comments</comments>
		<pubDate>Thu, 03 Sep 2009 11:08:04 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=2947</guid>
		<description><![CDATA[WordPress のテンプレートタグ wp_list_pages() を利用して、現在のページのサブページのみを表示させる。 パラメータの child_of に現在のページのページIDを指定する。 ページIDを指定しな [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress のテンプレートタグ <code>wp_list_pages()</code> を利用して、現在のページのサブページのみを表示させる。</p>
<p>パラメータの <code>child_of</code> に現在のページのページIDを指定する。<br />
ページIDを指定しない場合はデフォルト値の <code>0</code> が指定されたことになって全てのページを表示することになる。</p>
<pre><span class="Identifier">&lt;</span><span class="Statement">ul</span><span class="Identifier">&gt;</span>
<span class="Special">&lt;?php</span>
<span class="Statement">$</span><span class="Identifier">post</span> <span class="Statement">=</span> <span class="Statement">$</span><span class="Identifier">wp_query</span><span class="Type">-&gt;</span>post;
<span class="Statement">$</span><span class="Identifier">id</span> <span class="Statement">=</span> <span class="Statement">$</span><span class="Identifier">post</span><span class="Type">-&gt;</span>ID;
wp_list_pages<span class="Special">(</span>'<span class="Constant">title_li=&amp;child_of=</span>' <span class="Statement">.</span> <span class="Statement">$</span><span class="Identifier">id</span><span class="Special">)</span>;
<span class="Special">?&gt;</span>
<span class="Identifier">&lt;/</span><span class="Statement">ul</span><span class="Identifier">&gt;</span>
</pre>
<p>参考：<a href="http://wpdocs.sourceforge.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/wp_list_pages" class="out">テンプレートタグ/wp list pages &#8211; WordPress Codex 日本語版</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/2947/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress でブログの各アドレス情報を取得・表示する</title>
		<link>http://www.serendip.ws/archives/2941</link>
		<comments>http://www.serendip.ws/archives/2941#comments</comments>
		<pubDate>Wed, 02 Sep 2009 12:12:16 +0000</pubDate>
		<dc:creator>iNo</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.serendip.ws/?p=2941</guid>
		<description><![CDATA[比較的よく使いそうなブログのアドレス情報の取得の仕方をメモしておく。 以下の例に使用するサンプルアドレス。ブログのアドレスを WordPress をインストールしたディレクトリとは別のディレクトリに設定していると想定する [...]]]></description>
			<content:encoded><![CDATA[<p>比較的よく使いそうなブログのアドレス情報の取得の仕方をメモしておく。</p>
<p>以下の例に使用するサンプルアドレス。ブログのアドレスを WordPress をインストールしたディレクトリとは別のディレクトリに設定していると想定する。</p>
<p>http://hoge.com/wordpress/wp-content/themes/foo</p>
<p><code>bloginfo()</code> を使った場合、取得したデータはそのまま表示される。<br />
データを変数に代入することはできない。</p>
<pre>bloginfo<span class="Special">(</span>'<span class="Constant">name</span>'<span class="Special">)</span>; <span class="Comment">// ブログタイトル</span>
bloginfo<span class="Special">(</span>'<span class="Constant">url</span>'<span class="Special">)</span>; <span class="Comment">// ブログ URL : http://hoge.com</span>
bloginfo<span class="Special">(</span>'<span class="Constant">wpurl</span>'<span class="Special">)</span>; <span class="Comment">// wordpress ディレクトリ URL : http://hoge.com/wordpress</span>
bloginfo<span class="Special">(</span>'<span class="Constant">template_url</span>'<span class="Special">)</span>; <span class="Comment">// テンプレートファイル URL : http://hoge.com/wordpress/wp-content/themes/foo</span>
bloginfo<span class="Special">(</span>'<span class="Constant">stylesheet_url</span>'<span class="Special">)</span>; <span class="Comment">// style.css ファイル URL : http://hoge.com/wordpress/wp-content/themes/foo/style.css</span>
bloginfo<span class="Special">(</span>'<span class="Constant">stylesheet_directory</span>'<span class="Special">)</span>; <span class="Comment">// style.css ファイルのあるディレクトリの URL : http://hoge.com/wordpress/wp-content/themes/foo</span>
bloginfo<span class="Special">(</span>'<span class="Constant">template_directory</span>'<span class="Special">)</span>; <span class="Comment">// 使用中のテンプレートファイルのあるディレクトリの URL : http://hoge.com/wordpress/wp-content/themes/foo</span>
</pre>
<p><code>get_option()</code> を使った場合、取得したデータはそのままでは表示されない。表示させる場合は <code>echo</code> などを使う必要がある。<br />
取得したデータは変数に代入して使用することができる。</p>
<pre><span class="PreProc">echo</span> get_option<span class="Special">(</span>'<span class="Constant">home</span>'<span class="Special">)</span>; <span class="Comment">// ブログ URL : http://hoge.com</span>
<span class="PreProc">echo</span> get_option<span class="Special">(</span>'<span class="Constant">siteurl</span>'<span class="Special">)</span>; <span class="Comment">// wordpress ディレクトリ URL : http://hoge.com/wordpress</span>
<span class="PreProc">echo</span> get_option<span class="Special">(</span>'<span class="Constant">blogname</span>'<span class="Special">)</span>; <span class="Comment">// ブログタイトル</span>
<span class="PreProc">echo</span> get_option<span class="Special">(</span>'<span class="Constant">template</span>'<span class="Special">)</span>; <span class="Comment">// テンプレート名 foo</span>
</pre>
<p>参考：<a href="http://wpdocs.sourceforge.jp/%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%E3%82%BF%E3%82%B0/bloginfo" class="out">テンプレートタグ/bloginfo &#8211; WordPress Codex 日本語版</a><br />
　　　<a href="http://codex.wordpress.org/Function_Reference/get_option" class="out">Function Reference/get option « WordPress Codex</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.serendip.ws/archives/2941/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

