<?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>Little.ws &#187; wordpressタグ</title>
	<atom:link href="http://little.ws/tag/wordpress%e3%82%bf%e3%82%b0/feed" rel="self" type="application/rss+xml" />
	<link>http://little.ws</link>
	<description>web制作とかcssとかデザインとか色々～な覚え書き</description>
	<lastBuildDate>Sat, 04 Feb 2012 07:27:16 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>welcartとブログの共存：カテゴリの振り分け。大親カテゴリの追跡</title>
		<link>http://little.ws/201012/303.html</link>
		<comments>http://little.ws/201012/303.html#comments</comments>
		<pubDate>Mon, 20 Dec 2010 02:33:06 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[welcart]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressタグ]]></category>
		<category><![CDATA[カテゴリ]]></category>

		<guid isPermaLink="false">http://little.ws/?p=303</guid>
		<description><![CDATA[welcartでショップ＆ブログのページを作ってます。 アーカイブ、カテゴリページにおいて、 welcartにおける商品カテゴリと、ブログにおける記事カテゴリの振り分けするときのお話。 その記事が商品かブログ記事かを振り&#8230;]]></description>
			<content:encoded><![CDATA[<p>welcartでショップ＆ブログのページを作ってます。</p>
<p>アーカイブ、カテゴリページにおいて、<br />
welcartにおける商品カテゴリと、ブログにおける記事カテゴリの振り分けするときのお話。<br />
<span id="more-303"></span><br />
その記事が商品かブログ記事かを振り分けるときのコードは発見したけど、<br />
そのカテゴリが商品カテゴリか否かを振り分けるコードが無いみたいなので、cat_is_ancestor_of()を使用。</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php /* If this is a category archive */ if (is_category()) {
/* 現在のカテゴリのカテゴリIDを取得 */
$catnow = get_the_category();
$catnow = $catid[0];
/* welcartにおける商品カテゴリの親玉『商品』のcat_idを取得 */
$catitem = get_category_by_slug('item');
$catitem = $catitem-&gt;term_id; ?&gt;
</pre>
<p>ここまでで、現カテゴリーページのID及び、商品カテゴリの大親カテゴリIDの取得。<br />
あとは、現カテゴリーページが商品カテゴリの子もしくは孫に当たるかどうかを調べるので、</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if(cat_is_ancestor_of( $catitem, $catid ) or is_category($catitem)): ?&gt;
/* ここに商品カテゴリの場合の処理 */
&lt;?php else : ?&gt;
/* ここにブログ記事の場合の処理 */
&lt;?php endif; ?&gt;
</pre>
<p>以上で振り分けることが出来ます。</p>
<p>ちなみに<a href="http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/cat_is_ancestor_of" class="liexternal">cat is ancestor of()</a>についてはリファレンスにて確認を。</p>
<p>また、その記事が商品かブログ記事かを振り分けるときのコードに関しては、</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if(usces_is_item()): ?&gt;
</pre>
<p>という感じで便利な条件分岐タグが実装されているようです。<br />
このタグを使用して、月別あーカーイブ等のページでも通常の記事のレイアウトと商品の場合のレイアウトを分けることができます。</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php while (have_posts()) : the_post(); usces_the_item(); ?&gt;
&lt;?php if(usces_is_item()): ?&gt;
/* 商品の時の処理 */
&lt;?php else : ?&gt;
/* ブログ記事の場合の処理 */
&lt;?php endif; ?&gt;
&lt;?php endwhile; ?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/201012/303.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress:Similar Posts（Post-Plugin Library）の色々</title>
		<link>http://little.ws/200912/294.html</link>
		<comments>http://little.ws/200912/294.html#comments</comments>
		<pubDate>Thu, 10 Dec 2009 05:33:26 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[Wordpress応用]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[自分用覚え書き記事]]></category>
		<category><![CDATA[Post-Plugin Library]]></category>
		<category><![CDATA[Similar Posts]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressタグ]]></category>

		<guid isPermaLink="false">http://little.ws/?p=294</guid>
		<description><![CDATA[覚え書き。 Similar Posts内でのphpの使用とif文の書き方。 自分用記事です。 phpの書き方 そのまんま{php} とか。{php:~~~;}になって、{}内では{}と:が使えない。 IF文の書き方 クセ&#8230;]]></description>
			<content:encoded><![CDATA[<p>覚え書き。<br />
Similar Posts内でのphpの使用とif文の書き方。<br />
<span id="more-294"></span><br />
自分用記事です。</p>
<h4>phpの書き方</h4>
<p>そのまんま{php}</p>
<pre class="brush: php; title: ; notranslate">
{php:$i = 0;}
</pre>
<p>とか。{php:~~~;}になって、{}内では{}と:が使えない。</p>
<h4>IF文の書き方</h4>
<p>クセ有り。あんまり使えない。</p>
<pre class="brush: php; title: ; notranslate">
{if:$i = 0:yes:no}
</pre>
<p>形式的には{if:条件:true:false}というか{}内でのphpが使えない！？のか分からないので、上記のphp使った方がマシ。</p>
<h4>まとめ</h4>
<p>phpでifを使う場合。<br />
2行に分けると挙動がおかしいので、基本1行で。IF文も1行で行う。ただし、:(コロン)や{}が使えないのでtrue,false用を別々に書く必要有り。<br/><br />
ソースサンプル。カスタムキー(thum)に挿入した画像URLを取得し、thum内が空の場合はデフォルト画像URLを出力。</p>
<pre class="brush: php; title: ; notranslate">
&lt;img src=&quot;{php:$normal = ''. get_bloginfo('stylesheet_directory') .'/img/normal.jpg';$thumb=get_post_meta($result-&gt;ID, 'thum', true);if ($thumb)echo $thumb.' ';if ($thumb == '')echo $normal.' ';}&quot; alt=&quot;{title}&quot;&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/200912/294.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress：親カテゴリと子カテゴリのID取得（兄弟カテゴリ？）</title>
		<link>http://little.ws/200906/206.html</link>
		<comments>http://little.ws/200906/206.html#comments</comments>
		<pubDate>Mon, 08 Jun 2009 03:00:30 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[Wordpress応用]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressタグ]]></category>
		<category><![CDATA[人にやさしく]]></category>

		<guid isPermaLink="false">http://little.ws/?p=206</guid>
		<description><![CDATA[調べても無かったので覚え書き程度に。 先日は、wordpress:親カテゴリが同じな子カテゴリの一覧表示でリスト表示させたのですが、IDが欲しい！というときのために。。 まずはこの前と同じ。。。 ここまでで、親カテゴリの&#8230;]]></description>
			<content:encoded><![CDATA[<p>調べても無かったので覚え書き程度に。<br />
先日は、<a href="http://little.ws/200906/204.html" class="liinternal">wordpress:親カテゴリが同じな子カテゴリの一覧表示</a>でリスト表示させたのですが、IDが欲しい！というときのために。。<br />
<span id="more-206"></span><br />
まずはこの前と同じ。。。</p>
<pre class="brush: php; title: ; notranslate">
/* 現在のカテゴリの取得 */
$cat_now = get_the_category();
$cat_now = $cat_now[0];

/*親カテゴリのID取得*/

$parent_id = $cat_now-&gt;category_parent;
</pre>
<p>ここまでで、親カテゴリのIDを取得します。<br />
ちなみに超初歩的なことですが、get_the_categoryはループ内で使うタグですので。。。<br/><br />
あとはget_category_childrenというタグを使用します。<br />
このタグに関してはリファレンスが無かったりするので・・<br />
ソースは</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php $cat_children = get_category_children($parent_id); ?&gt;
</pre>
<p>こんな感じです。<br />
get_category_childrenに関しては、<br/><br />
<strong>get_category_children(親カテゴリーID, before,after)</strong><br/><br />
以上の表記になります。<br />
デフォルトでは。IDの間に『/』が入りますので、以上の表記をいじって変える感じです。<br />
これで兄弟カテゴリ（姉妹カテゴリ）のID取得できます。</p>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/200906/206.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress:親カテゴリが同じな子カテゴリの一覧表示</title>
		<link>http://little.ws/200906/204.html</link>
		<comments>http://little.ws/200906/204.html#comments</comments>
		<pubDate>Mon, 01 Jun 2009 02:17:13 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[Wordpress応用]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressタグ]]></category>
		<category><![CDATA[応用]]></category>

		<guid isPermaLink="false">http://little.ws/?p=204</guid>
		<description><![CDATA[タイトルの通りです。 親カテゴリのIDが分かっている場合、 たとえば親カテゴリのIDが1のとき、 でいいのです、んで、親カテゴリはもちろん記事や子カテゴリによって違うわけです。 なので、親カテゴリデータ受け取り→加工の手&#8230;]]></description>
			<content:encoded><![CDATA[<p>タイトルの通りです。<br/><br />
親カテゴリのIDが分かっている場合、<br />
たとえば親カテゴリのIDが1のとき、</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php　wp_list_categories('child_of=1'); ?&gt;
</pre>
<p>でいいのです、んで、親カテゴリはもちろん記事や子カテゴリによって違うわけです。<br />
なので、親カテゴリデータ受け取り→加工の手順が必要です。<br />
では手順は以下から。<br />
<span id="more-204"></span><br />
手順としては、現在のカテゴリの取得→親カテゴリの取得になります。<br />
<a href="http://phpress.enjoy-life-style.com/archives/57" class="liexternal">親カテゴリーIDの取得 &raquo; PHPpress for WordPress</a>より</p>
<pre class="brush: php; title: ; notranslate">
/* 現在のカテゴリ－の取得 */
$cat_now = get_the_category();
$cat_now = $cat_now[0];

/*親カテゴリーのID取得*/

$parent_id = $cat_now-&gt;category_parent;
</pre>
<p>んで、さっきのと組み合わせるだけなので、続いて</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php　wp_list_categories(&quot;child_of=$parent_id&quot;); ?&gt;
</pre>
<p>でOKです。<br />
全部まとめると</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$cat_now = get_the_category();
$cat_now = $cat_now[0];
$parent_id = $cat_now-&gt;category_parent;
?&gt;
&lt;?php wp_list_categories(&quot;title_li=&amp;child_of=$parent_id&quot;); ?&gt;
</pre>
<p>こんな感じ？</p>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/200906/204.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress:カスタムフィールドを使いやすく！その２</title>
		<link>http://little.ws/200903/193.html</link>
		<comments>http://little.ws/200903/193.html#comments</comments>
		<pubDate>Wed, 18 Mar 2009 03:35:25 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpressタグ]]></category>
		<category><![CDATA[カスタムフィールド]]></category>
		<category><![CDATA[人にやさしく]]></category>

		<guid isPermaLink="false">http://little.ws/?p=193</guid>
		<description><![CDATA[カスタムフィールドを呼び出す方法、wordpress:Get Custom Field Valuesでプラグインを使用して呼び出す方法は書いていたみたいです。 これ、先の記事（wordpress:カスタムフィールドを使い&#8230;]]></description>
			<content:encoded><![CDATA[<p>カスタムフィールドを呼び出す方法、<a href="http://little.ws/200901/103.html" class="liinternal">wordpress:Get Custom Field Values</a>でプラグインを使用して呼び出す方法は書いていたみたいです。<br />
これ、先の記事（<a href="http://little.ws/200903/182.html" class="liinternal">wordpress:カスタムフィールドを使いやすく！</a>）の続きですので、先にそっちを読んだ方がいいです。<br/><br />
でも、今回はプラグインを使用せずに呼び出しましょう。<br />
<span id="more-193"></span><br />
前回の記事で、サムネイル表示用のメタボックスを作成したので、<br />
それを呼び出してあげましょう。<br />
先にソース書きます！</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;eximg&quot;&gt;
	&lt;?php
		$smallimg = get_post_meta($post-&gt;ID, &quot;smallimg_value&quot;, true);
	?&gt;

   &lt;p&gt;
	&lt;?php if($smallimg !== '') { ?&gt;
	&lt;a title=&quot;&lt;?php the_title(); ?&gt;&quot; href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;img style=&quot;width:100px; height:100px;&quot; src=&quot;&lt;?php echo $smallimg; ?&gt;&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot;/&gt;&lt;/a&gt;
	&lt;?php } else { ?&gt;
	&lt;a title=&quot;&lt;?php the_title(); ?&gt;&quot; href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('template_url'); ?&gt;/images/postsmall.jpg&quot; style=&quot;width:100px; height:100px; &quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot;/&gt;&lt;/a&gt;
    &lt;?php } ?&gt;
   &lt;/p&gt;
&lt;/div&gt;
</pre>
<p>簡単に説明すると、メタボックスに入力した画像を読み込み表示プラス記事へのリンクです。<br />
んで、もしメタボックスに何も入力されていないときは、テーマフォルダ内の/images/postsmall.jpgという画像を表示させて記事へのリンクを張ります。<br />
ただ、これは先の記事で書いたstdの部分にデフォルトの画像として入力しておいてあげればすむことなのですが、<br />
万が一空白にしてしまったときのための保険みたいなモノとして書いてあげています。<br />
100pxの値は任意の値に変えてあげて下さい。</p>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/200903/193.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress:カスタムフィールドを使いやすく！</title>
		<link>http://little.ws/200903/182.html</link>
		<comments>http://little.ws/200903/182.html#comments</comments>
		<pubDate>Wed, 18 Mar 2009 03:22:19 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressタグ]]></category>
		<category><![CDATA[カスタムフィールド]]></category>
		<category><![CDATA[人にやさしく]]></category>

		<guid isPermaLink="false">http://little.ws/?p=182</guid>
		<description><![CDATA[wordpressのカスタムフィールドを無駄にしている人がきっと沢山いると思います。 こんなに便利なものを！！ でもきっと、使いにくいと思っている人もおおいはず。 ましてや、素人さんに、カスタムフィールドを使用させるのも&#8230;]]></description>
			<content:encoded><![CDATA[<p>wordpressのカスタムフィールドを無駄にしている人がきっと沢山いると思います。<br/><br />
こんなに便利なものを！！<br />
でもきっと、使いにくいと思っている人もおおいはず。<br />
ましてや、素人さんに、カスタムフィールドを使用させるのも・・。<br/><br />
ということで、今回はカスタムフィールドをばっちり使いやすくします。<br />
以下の画像の様に投稿画面に誰でも分かりやすい入力欄を作成します。<br />
<a href="http://little.ws/wp-content/uploads/2009/03/custom_panel.jpg" rel="fancybox-gallery" rel='lightbox' class="liimagelink"><img src="http://little.ws/wp-content/uploads/2009/03/custom_panel-300x257.jpg" alt="custom_panel" title="custom_panel" width="300" height="257" class="alignnone size-medium wp-image-183" /></a><br />
<span id="more-182"></span><br />
functions.phpに書いてもOKですが、すぐぐちゃぐちゃになっちゃうので、今回は別にFileを作っちゃいます。<br />
適当なFile名でOKです。ではソースを</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

	$work_meta_boxes =
	array(
	&quot;smallimg&quot; =&gt; array(
	&quot;name&quot; =&gt; &quot;smallimg&quot;,
	&quot;std&quot; =&gt; &quot;&quot;,
	&quot;title&quot; =&gt; &quot;サムネイルイメージ&quot;,
	&quot;description&quot; =&gt; &quot;画像をUPした場合、画像のサムネイルimgのアドレスをコピペ！&quot;)

/* 以下の段落をカスタムして増やせます。
	&quot;company&quot; =&gt; array(
	&quot;name&quot; =&gt; &quot;カスタムフィールドの名前&quot;,
	&quot;std&quot; =&gt; &quot;&quot;,
	&quot;title&quot; =&gt; &quot;入力欄のタイトル&quot;,
	&quot;description&quot; =&gt; &quot;説明文（ﾀｸﾞ使用可能）&quot;),
*/

	);
</pre>
<p>今回は『smallimg』という名前のカスタムフィールドで『サムネイルイメージ』がタイトルです。descriptionはその通り説明書きみたいなものです。stdは初期値です。初期値の変更で、imgが無いときにデフォルトの画像URLを入力しておくとか、そんな感じの使い方です。<br/><br />
次に、投稿画面への入力欄の追加のために以下を追加。</p>
<pre class="brush: php; title: ; notranslate">
	function work_meta_boxes() {
		global $post, $work_meta_boxes;
		foreach($work_meta_boxes as $meta_box) {
			$meta_box_value = get_post_meta($post-&gt;ID, $meta_box['name'].'_value', true);

			if($meta_box_value == &quot;&quot;)
			$meta_box_value = $meta_box['std'];

			echo'&lt;input type=&quot;hidden&quot; name=&quot;'.$meta_box['name'].'_noncename&quot; id=&quot;'.$meta_box['name'].'_noncename&quot; value=&quot;'.wp_create_nonce( plugin_basename(__FILE__) ).'&quot; /&gt;';

			echo'&lt;h2&gt;'.$meta_box['title'].'&lt;/h2&gt;';

			echo'&lt;input type=&quot;text&quot; name=&quot;'.$meta_box['name'].'_value&quot; value=&quot;'.$meta_box_value.'&quot; size=&quot;55&quot; /&gt;&lt;br /&gt;';

			echo'&lt;p&gt;&lt;label for=&quot;'.$meta_box['name'].'_value&quot;&gt;'.$meta_box['description'].'&lt;/label&gt;&lt;/p&gt;';
		}
	}

	function create_meta_box() {
		global $theme_name;

		if ( function_exists('add_meta_box') )
			add_meta_box( 'work-meta-boxes', 'TOPページサムネイル追加', 'work_meta_boxes', 'post', 'normal', 'high' );
	}
</pre>
<p>この辺の説明は割愛します。<br />
知りたければ書きますが・・<br/><br />
上のソースの23行目の説明だけ・・</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php add_meta_box('id', 'title', 'callback', 'page', 'context', 'priority'); ?&gt;
</pre>
<p><strong>id </strong><br />
    編集画面でのID（識別名）です。<br />
<strong>title </strong><br />
    編集画面で表示されるタイトル（ラベル）です。<br />
<strong>callback </strong><br />
    コールバック関数です。（今回はwork_meta_boxes）<br />
<strong>page</strong><br />
    投稿画面orページ作成画面orリンク編集画面どれで表示させるか。 (&#8216;post&#8217;, &#8216;page&#8217;, or &#8216;link&#8217;)<br />
<strong>context </strong><br />
    コンテキスト<br />
<strong>priority </strong><br />
    プライオリティ（優先順位です）。メタボックスが呼び出される順番。<br/><br />
あとは、記事と一緒に入力したデータをどこに保存するかの設定です。</p>
<pre class="brush: php; title: ; notranslate">
	function save_postdata( $post_id ) {
		global $post, $work_meta_boxes;
		foreach($work_meta_boxes as $meta_box) {
		// Verify
			if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {
				return $post_id;
			}

			if ( 'page' == $_POST['post_type'] ) {
				if ( !current_user_can( 'edit_page', $post_id ))
					return $post_id;
			} else {
				if ( !current_user_can( 'edit_post', $post_id ))
					return $post_id;
			}

			$data = $_POST[$meta_box['name'].'_value'];

			if(get_post_meta($post_id, $meta_box['name'].'_value') == &quot;&quot;)
				add_post_meta($post_id, $meta_box['name'].'_value', $data, true);
			elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))
				update_post_meta($post_id, $meta_box['name'].'_value', $data);
			elseif($data == &quot;&quot;)
				delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));
		}
	}
</pre>
<p>ここも割愛。<br/><br />
んで、最後に</p>
<pre class="brush: php; title: ; notranslate">
	add_action('admin_menu', 'create_meta_box');
	add_action('save_post', 'save_postdata');
</pre>
<p>あとはfunctions.phpに以下の一文を付け足して、呼び出してあげましょう。</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	include_once (TEMPLATEPATH . '/保存したfile名.php');
?&gt;
</pre>
<p>なんだか説明になってないので、File上げときます。<br />
適当にいじって使って下さい。<br/><br />
ダウンロードする方、何かｺﾒいただけるとうれしいです。<br />
<strong>右クリ保存でお願いしますYO</strong><br />
<a href="http://little.ws/wp-content/uploads/2009/03/custom-write-panel.zip" class="lizip">ダウンロード</a><br/><br />
functions.phpだけは自分で一文を付け足して下さい。<br />
カスタムフィールドの呼び出し方は。。前に書いた気がするので探して下さいｗ<br />
無ければ後で書きます。</p>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/200903/182.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wp初めてのテーマ作成時に役立ちそうな記事</title>
		<link>http://little.ws/200901/141.html</link>
		<comments>http://little.ws/200901/141.html#comments</comments>
		<pubDate>Wed, 21 Jan 2009 04:51:28 +0000</pubDate>
		<dc:creator>chibi</dc:creator>
				<category><![CDATA[Wordpress基礎編]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpressタグ]]></category>
		<category><![CDATA[wordpressテーマ]]></category>
		<category><![CDATA[ブックマーク]]></category>
		<category><![CDATA[人にやさしく]]></category>

		<guid isPermaLink="false">http://little.ws/?p=141</guid>
		<description><![CDATA[WordPressのテンプレート作成時に欠かせない有用チートシート:phpspot開発日誌 初めてのテーマ作成時に役立ちそうな記事。 元記事　My WordPress Cheat Sheet：Graphic Rating&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://phpspot.org/blog/archives/2009/01/wordpress_9.html" class="liexternal">WordPressのテンプレート作成時に欠かせない有用チートシート:phpspot開発日誌</a><br />
初めてのテーマ作成時に役立ちそうな記事。<br />
元記事　<a href="http://www.graphicrating.com/2009/01/18/my-wordpress-cheat-sheet/" class="liexternal">My WordPress Cheat Sheet：Graphic Rating</a><br />
<span id="more-141"></span><br />
Bloginfoタグとか未だに忘れるので・・記事を日本語にして覚え書き<br/></p>
<h4>Template Bloginfoタグ</h4>
<pre class="brush: php; title: ; notranslate">
&lt;?php bloginfo('name'); ?&gt; - ブログタイトルを出力
&lt;?php bloginfo('charset'); ?&gt; - 文字コード(UTF-8とか)を出力
&lt;?php bloginfo('description'); ?&gt; - ブログのdescriptionを出力
&lt;?php bloginfo('url'); ?&gt; - 一般設定で設定したブログアドレスを出力
&lt;?php bloginfo('rss2_url'); ?&gt; - RSSのURLを出力
&lt;?php bloginfo('template_url'); ?&gt; - テーマ（テンプレート）のURLを出力
&lt;?php bloginfo('pingback_url'); ?&gt; - ピンバック（トラックバック）用URLを出力
&lt;?php bloginfo('stylesheet_url'); ?&gt; - テーマのスタイルシートURLを出力
&lt;?php bloginfo('wpurl'); ?&gt; - WordPressのURLを出力
&lt;?php bloginfo('template_directory'); ?&gt; - テーマのディレクトリを出力
</pre>
<h4>一般的なタグ</h4>
<pre class="brush: php; title: ; notranslate">
&lt; ?php the_time() ?&gt; - 現在の記事の投稿・更新時間出力
&lt; ?php the_date() ?&gt; - 記事の投稿・更新日を出力
&lt; ?php the_title(); ?&gt; - 記事のタイトルを出力
&lt; ?php the_permalink() ?&gt; - 記事のURLを出力
&lt; ?php the_category() ?&gt; - 記事のカテゴリを出力
&lt; ?php the_author(); ?&gt; - 投稿者を出力
&lt; ?php the_ID(); ?&gt; - 現在の記事のIDを出力
&lt; ?php wp_list_pages(); ?&gt; - ページ一覧を出力
&lt; ?php wp_tag_cloud(); ?&gt; - タグクラウドを出力
&lt; ?php wp_list_cats(); ?&gt; - カテゴリ一覧を出力
&lt; ?php get_calendar(); ?&gt; - カレンダを出力
&lt; ?php wp_get_archives() ?&gt; - アーカイブを出力
&lt; ?php posts_nav_link(); ?&gt; - 新しい記事及び古い記事へのリンクを出力
&lt; ?php next_post_link() ?&gt; - 新しい記事へのリンクを出力
&lt; ?php previous_post_link() ?&gt; - 古い記事へのリンクを出力
</pre>
<h4>自分で作成したテンプレートファイルの読み込み</h4>
<pre class="brush: php; title: ; notranslate">
&lt; ?php include (TEMPLATEPATH . '/hogehoge.php'); ?&gt;
</pre>
<h4>ループについて</h4>
<pre class="brush: php; title: ; notranslate">
&lt; ?php if(have_posts()) : ?&gt;
   &lt; ?php while(have_posts()) : the_post(); ?&gt;
// Custom HTML &amp; PHP code
   &lt; ?php endwhile; ?&gt;
&lt; ?php else : ?&gt;
&lt; ?php endif; ?&gt;
</pre>
<p>タグによって、ループ内で使用と指定されるものがありますが、<br />
その場合は基本的に上記のソース内で使用します。<br/><br />
元ページより一部抜粋しました。</p>
]]></content:encoded>
			<wfw:commentRss>http://little.ws/200901/141.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

