<?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>Executable PHP widget &#8211; トモデジ  tomodigi.com</title>
	<atom:link href="https://tomodigi.com/tag/executable-php-widget/feed/" rel="self" type="application/rss+xml" />
	<link>https://tomodigi.com</link>
	<description>デジタルもアナログも</description>
	<lastBuildDate>Wed, 02 May 2012 08:43:23 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>最近の投稿を逆順（古い順）に表示 (WordPress)</title>
		<link>https://tomodigi.com/web/wordpress/%e6%9c%80%e8%bf%91%e3%81%ae%e6%8a%95%e7%a8%bf%e3%82%92%e9%80%86%e9%a0%86%ef%bc%88%e5%8f%a4%e3%81%84%e9%a0%86%ef%bc%89%e3%81%ab%e8%a1%a8%e7%a4%ba-wordpress/</link>
					<comments>https://tomodigi.com/web/wordpress/%e6%9c%80%e8%bf%91%e3%81%ae%e6%8a%95%e7%a8%bf%e3%82%92%e9%80%86%e9%a0%86%ef%bc%88%e5%8f%a4%e3%81%84%e9%a0%86%ef%bc%89%e3%81%ab%e8%a1%a8%e7%a4%ba-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Tomo]]></dc:creator>
		<pubDate>Wed, 02 May 2012 19:28:08 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Executable PHP widget]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ウィジェット]]></category>
		<guid isPermaLink="false">http://www.tomodigi.com/?p=959</guid>

					<description><![CDATA[WordPressのウィジェットには「最近の投稿」というものがあります。これは上から最新の記事が表示されます。 これを古い順に並べようと思うと、テーマファイルを編集することになりますが、新しくウィジェットにPHPで記述す &#8230; <a href="https://tomodigi.com/web/wordpress/%e6%9c%80%e8%bf%91%e3%81%ae%e6%8a%95%e7%a8%bf%e3%82%92%e9%80%86%e9%a0%86%ef%bc%88%e5%8f%a4%e3%81%84%e9%a0%86%ef%bc%89%e3%81%ab%e8%a1%a8%e7%a4%ba-wordpress/" class="more-link">続きを読む <span class="screen-reader-text">最近の投稿を逆順（古い順）に表示 (WordPress)</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>WordPressのウィジェットには「最近の投稿」というものがあります。これは上から最新の記事が表示されます。</p>
<p>これを古い順に並べようと思うと、テーマファイルを編集することになりますが、新しくウィジェットにPHPで記述すれば応用範囲も広がります。</p>
<p>まずは、ウィジェット中のPHPを有効にするために、<a title="WordPress &amp;#8250; PHP Code Widget &amp;laquo; WordPress Plugins" href="http://wordpress.org/extend/plugins/php-code-widget/" target="_blank">Executable PHP widget</a>などのプラグインを入れます。</p>
<p>新たにウィジェットを作り、下記のようなコードを記述します。これで、古い順に5件表示されます。</p>
<pre>&lt;ul&gt;
&lt;?php
$posts = get_posts('numberposts=5&amp;order=ASC&amp;orderby=date');
global $post;
?&gt;
&lt;?php
if($posts): foreach($posts as $post): setup_postdata($post); ?&gt;
&lt;li&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/li&gt;
&lt;?php endforeach; endif;
?&gt;
&lt;/ul&gt;</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://tomodigi.com/web/wordpress/%e6%9c%80%e8%bf%91%e3%81%ae%e6%8a%95%e7%a8%bf%e3%82%92%e9%80%86%e9%a0%86%ef%bc%88%e5%8f%a4%e3%81%84%e9%a0%86%ef%bc%89%e3%81%ab%e8%a1%a8%e7%a4%ba-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
