<?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>STUDIO Bloom 大阪・北摂地域を中心としたWebサイト・システム制作 &#187; Wordpress</title>
	<atom:link href="http://www.studio-bloom.net/archives/category/web%e9%96%a2%e4%bf%82/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.studio-bloom.net</link>
	<description>高槻を拠点に、大阪・北摂を中心としたWebデザイン・システム構築 STUDIO Bloom</description>
	<lastBuildDate>Sun, 25 Jul 2010 16:14:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</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://www.studio-bloom.net/archives/category/web%e9%96%a2%e4%bf%82/wordpress/feed" />
		<item>
		<title>Wordpressでページ内に記事一覧サムネイル</title>
		<link>http://www.studio-bloom.net/archives/2182</link>
		<comments>http://www.studio-bloom.net/archives/2182#comments</comments>
		<pubDate>Thu, 22 Apr 2010 01:17:23 +0000</pubDate>
		<dc:creator>板</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.studio-bloom.net/?p=2182</guid>
		<description><![CDATA[久しぶりのWordpressネタです。
次のVer.3からはマルチブログにも対応するなど、このところ進み具合が半端無い感じのWPですが（アップグレードでコケるところ多そうだなぁ…）。
ページ内で記事の一覧とそのサムネイル [...]]]></description>
			<content:encoded><![CDATA[<p>久しぶりのWordpressネタです。<br />
次のVer.3からはマルチブログにも対応するなど、このところ進み具合が半端無い感じのWPですが（アップグレードでコケるところ多そうだなぁ…）。</p>
<p>ページ内で記事の一覧とそのサムネイル画像を表示させたい、という要求は往々にしてあると思うのですが、それをなんとか使用者にも使いやすい形で実装できないものか…と。</p>
<p>最初に考えたのはカスタムフィールドを使用して、アップロードしたファイルのURLを入れてもらう。。。は手間が増えるし、おそらくイマイチ分かりにくい操作だなぁ。。。と。<br />
記事内の最初に出てくる画像を正規表現で取得して…矩形のサムネイルだと良いけど、中・大の画像サイズとファイル名が不明…<br />
Ver 2.9から実装されているthe_post_thumbnail()はなにも表示されない…</p>
<p>ということで実装したのがこちら、</p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showCodeTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$posts</span> = get_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'numberposts=5&amp;category=3'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$posts</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$post</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; setup_postdata<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$dat</span> = get_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'post_type=attachment&amp;orderby=menu_order&amp;order=ASC&amp;numberposts=1&amp;post_parent='</span>.get_the_ID<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dat</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt; <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$image</span> = wp_get_attachment_image_src<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$dat</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>-&gt;<span style="color:#006600;">ID</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$desc</span> = <span style="color:#FF0000;">'&lt;img src=&quot;'</span>.<span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#FF0000;">'&quot; width=&quot;'</span>.<span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#FF0000;">'&quot; height=&quot;'</span>.<span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#FF0000;">'&quot; alt=&quot;&quot; /&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// 記事出力</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$desc</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>get_posts()にパラメータ「post_type=attachment」を指定すると、「post_parent」に与えた記事IDに紐付いているデータを取得できます。その他のパラメータは並び順の先頭にある1件のみを取得する指定です。ギャラリーダイアログで1番上に指定している物を取得する仕様にしました。<br />
配列にはそれぞれファイルURL・幅・高さが入っています。</p>
<p>お客さんにはサムネイルに表示したい画像をアップロード、1番上に移動してもらうだけ。記事内にその画像を表示させたくなければ挿入しなければ良いだけで、ギャラリーの1番上にある画像が自動的に表示されるのは分かりやすいかな？と（サムネイルは表示させたくないけど、記事中に何か画像を表示したい、という希望には添えませんが…orz）。</p>
<p>次のネタは「ページ内で記事を表示させたい。そしてページングも表示させたい」です。ネタは小出しでｗ</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-bloom.net/archives/2182/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.studio-bloom.net/archives/2182" />
	</item>
		<item>
		<title>Wordpressで記事に投稿した画像一覧をProgression用のXMLで出力</title>
		<link>http://www.studio-bloom.net/archives/1774</link>
		<comments>http://www.studio-bloom.net/archives/1774#comments</comments>
		<pubDate>Mon, 03 Aug 2009 15:47:35 +0000</pubDate>
		<dc:creator>板</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.studio-bloom.net/?p=1774</guid>
		<description><![CDATA[ラーメン屋のネタを華麗にスルーしつつ、タイトルの長すぎるエントリーです。
しかも解説無しという暴挙！読者をなんだと思ってるんだ！
Wordpressで記事に投稿した画像一覧をProgression用のXMLで出力するため [...]]]></description>
			<content:encoded><![CDATA[<p>ラーメン屋のネタを華麗にスルーしつつ、タイトルの長すぎるエントリーです。<br />
しかも解説無しという暴挙！読者をなんだと思ってるんだ！</p>
<p>Wordpressで記事に投稿した画像一覧をProgression用のXMLで出力するためのテンプレートです。<br />
（元ネタは<a href="http://flabaka.com/blog/?p=1209">こちら</a>を参考にさせて頂きました。深謝）</p>
<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showCodeTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#008000;">/*</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Template Name: scenedataXML</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Type: text/xml; charset='</span>.get_option<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'blog_charset'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;?xml version=&quot;1.0&quot; encoding=&quot;'</span>.get_option<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'blog_charset'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#FF0000;">'&quot;?'</span>.<span style="color:#FF0000;">'&gt;'</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;prml version=&quot;2.0.0&quot; type=&quot;text/prml&quot;&gt;'</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> query_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"order=DESC"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>have_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span>have_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> : the_post<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$d</span> = the_date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Y-m-d'</span>, <span style="color:#FF0000;">''</span>, <span style="color:#FF0000;">''</span>, <span style="color:#FF0000;">''</span>, <span style="color:#000000; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$attachments</span> = get_children<span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'post_parent'</span> =&gt; get_the_ID<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#FF0000;">'post_type'</span> =&gt; <span style="color:#FF0000;">'attachment'</span>, <span style="color:#FF0000;">'post_mime_type'</span> =&gt; <span style="color:#FF0000;">'image'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/is_array"><span style="color:#000066;">is_array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$attachments</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$attachments</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$key</span> =&gt; <span style="color:#0000FF;">$row</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$mo</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span>&nbsp; = <span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">menu_order</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$aid</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF;">$key</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$row</span>-&gt;<span style="color:#006600;">ID</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array_multisort"><span style="color:#000066;">array_multisort</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mo</span>, SORT_ASC,<span style="color:#0000FF;">$aid</span>,SORT_DESC,<span style="color:#0000FF;">$attachments</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$attachments</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$row</span> =&gt; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/preg_match"><span style="color:#000066;">preg_match</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/src=&quot;(.*?)&quot;(.*?)title=&quot;(.*?)&quot;/ie'</span>, wp_get_attachment_image<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span>-&gt;<span style="color:#006600;">ID</span>, <span style="color:#FF0000;">'thumbnail'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$thumb</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/preg_match"><span style="color:#000066;">preg_match</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'/src=&quot;(.*?)&quot;(.*?)title=&quot;(.*?)&quot;/ie'</span>, wp_get_attachment_image<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span>-&gt;<span style="color:#006600;">ID</span>, <span style="color:#FF0000;">'full'</span><span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;scene name=<span style="color:#FF0000;">"&lt;?php echo the_title(); ?&gt;"</span> cls=<span style="color:#FF0000;">"myproject.scenes.ImageScene"</span> title=<span style="color:#FF0000;">"&lt;?php echo $image[3]."</span> | <span style="color:#FF0000;">";the_title(); ?&gt;"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;num&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>; ?&gt;&lt;/num&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;cap&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>; ?&gt;&lt;/cap&gt;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;thumb&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$thumb</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>; ?&gt;&lt;/thumb&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;path&gt;&lt;?php&nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$image</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>; ?&gt;&lt;/path&gt;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;date&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$d</span>; ?&gt;&lt;/date&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;category&gt;&lt;?php <span style="color:#0000FF;">$cat</span> = get_the_category<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#0000FF;">$cat</span> = <span style="color:#0000FF;">$cat</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>; <span style="color:#006600; font-weight:bold;">&#123;</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$cat</span>-&gt;<span style="color:#006600;">cat_name</span>;<span style="color:#006600; font-weight:bold;">&#125;</span> ?&gt;&lt;/category&gt;</div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/scene&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#121212;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#4D4D4D;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">endwhile</span>; <span style="color:#616100;">endif</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Progressionはプログラミングの知識がなくても柔軟且つ簡単ににフルフラッシュサイトを作れる工夫が成されてる割に、細かいことをやろうとしたら意外に奥が深いフレームワークです。ちょっと世界観の把握に苦労した。</p>
<p>あとはこの出力されたXMLをProgressionで読んで、Papervision3Dと絡めて…</p>
<p>という実験的勉強を、クライアントからの連絡をずーっと待ちながらイヂけつつやっている梅雨が明けたある暑い夏の日。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-bloom.net/archives/1774/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.studio-bloom.net/archives/1774" />
	</item>
		<item>
		<title>【覚え書き】Wordpressのスラッグの扱い</title>
		<link>http://www.studio-bloom.net/archives/1052</link>
		<comments>http://www.studio-bloom.net/archives/1052#comments</comments>
		<pubDate>Mon, 02 Mar 2009 09:25:46 +0000</pubDate>
		<dc:creator>板</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[覚え書き]]></category>

		<guid isPermaLink="false">http://www.studio-bloom.net/?p=1052</guid>
		<description><![CDATA[フロントページを“固定”にして、投稿ページを何かに指定した場合、ページスラッグは入力した物じゃなくて投稿のタイトルがエンコードされた物が返ってくる。
ページスラッグを利用してページごとのCSSを読み込むようにしていたので [...]]]></description>
			<content:encoded><![CDATA[<p>フロントページを“固定”にして、投稿ページを何かに指定した場合、ページスラッグは入力した物じゃなくて投稿のタイトルがエンコードされた物が返ってくる。</p>
<p>ページスラッグを利用してページごとのCSSを読み込むようにしていたので、ここで大はまり。で、ナニをどうやっても投稿ページで指定しているスラッグを引っ張れないので考えた案。</p>
<p>投稿ページを指定すると、そのページはis_page()がfalseになるので、（逆説的に）is_page() === trueの場合のみページスラッグを使ってCSSを指定し、falseの時は投稿ページと判断して、ブログ用のCSSを読み込ませる。</p>
<p>＃Ver2.7.1でのお話です。他にも別の解決策などあるかもしれません。</p>
<p>というかページテンプレートも指定できなくなるのは仕様なのか？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.studio-bloom.net/archives/1052/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.studio-bloom.net/archives/1052" />
	</item>
	</channel>
</rss>
