<?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>Base Views</title>
	<atom:link href="http://baseviews.com/feed" rel="self" type="application/rss+xml" />
	<link>http://baseviews.com</link>
	<description>Knowledge Database for Happy Life</description>
	<lastBuildDate>Tue, 09 Mar 2010 17:34:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPressで特定のカテゴリだけを非表示にする方法</title>
		<link>http://baseviews.com/wordpress/wordpress-category-hide.html</link>
		<comments>http://baseviews.com/wordpress/wordpress-category-hide.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:22:13 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1898</guid>
		<description><![CDATA[WordPressで特定のカテゴリだけを表示したくない場合の対処。

query_postsを呼ぶとき、表示したくないカテゴリのIDにマイナスをつけて指定する。カテゴリID5を表示したくない場合はこう。

query_posts('cat=-5');

なんて便利な…。表示したくないカテゴリが複数ある時は、&#038;でつないでいく。

query_posts('cat=-5&#038;cat=-8');

上の例だとカテゴリID5とID8が非表示になる。で、こういう感じで。

&#60;?php
　query_posts('cat=-5&#038;showposts=10');
　　while( have_posts() ){
　　　the_post();
　　　echo the_time(__('Y年n月j日 l G時i分') );
　　　echo the_permalink();
　　　echo get_the_title();
　　　echo the_content('read more...');
　　}
　wp_reset_query();
?&#62;

showposts=10は10記事分表示したいってことですね。これを5記事にするならshowposts=5。
上の例とは別で、while文の中にif(in_category(&#8217;n')) continue;を挟む書き方もある。この場合はnの部分をカテゴリIDにする。初めは僕もそのやり方にしてたんだけど、上で紹介したやり方の方が断然いいと思う。というのは、if(in_category(&#8217;n')) continue;だと、showposts=&#8217;n'で指定した通りの記事数を表示するために、カウントをとらなければならないからだ。

&#60;?php
　query_posts('showposts=10');
　　while(have_posts()) :
　　　the_post();
　　　if (in_category('5')) continue;
　　　echo '&#60;h2&#62;&#60;a href="';
　　　echo the_permalink();
　　　echo '"&#62;'. get_the_title().'&#60;/a&#62;&#60;/h2&#62;';
　　　echo the_content('read more...');
　　endwhile;
　wp_reset_query();
?&#62;

この書き方だと、showposts=10で10記事分を表示しようとしても、10記事以下しか表示されない場合がある。例えば呼び出した10記事中にカテゴリID5が2記事混じっていると、その分を飛ばすので8記事しか表示してくれない。showposts=3の時に、非表示指定したカテゴリーの記事が3記事あると、表示される記事数が0になってしまう。

&#60;?php
　query_posts('showposts=30');
　count = 0;
　while( have_posts() &#038;&#038; count &#60; 10 ) :
　　the_post();
　　if (in_category('5')) continue;
　　echo '&#60;h2&#62;&#60;a href="';
　　echo the_permalink();
　　echo '"&#60;'. get_the_title().'&#60;/a&#62;&#60;/h2&#62;';
　　echo the_content('read more...');
　　count++;
　endwhile;
　wp_reset_query();
?&#62;

なので上のようにしてカウントをとれば、if (in_category(&#8217;5&#8242;)) continue;でも10記事表示されるようになるんだけど、そんなことするくらいなら初めからquery_posts (&#8217;at=-n&#8217;) にした方が良いですね。
]]></description>
		<wfw:commentRss>http://baseviews.com/wordpress/wordpress-category-hide.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月9日の東京株式市場｜日経平均18円安、前日終値挟み小動き</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%889%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%889%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:59:31 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1892</guid>
		<description><![CDATA[<h2>東京株式市場概況</h2>
2010年3月9日の東京株式市場は日経平均株価が18円27銭安の1万567円65銭、TOPIXは2.93ポイント安の924.38ポイントと3日ぶり反落。東証1部の出来高は16億1529万株、売買代金は1兆1025億円。騰落銘柄数は値上がり589銘柄、値下がり920銘柄。25日騰落レシオは107.13％。新高値は38銘柄、新安値は4銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%889%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月9日の新興市場｜IPOの大光は公開価格割れスタート</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%889%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%889%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Tue, 09 Mar 2010 14:00:37 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1895</guid>
		<description><![CDATA[<h2>新興市場概況</h2>
2010年3月9日の新興市場は日経ジャスダック平均が0.08％高と3日続伸、東証マザーズ指数が0.09％安と3日ぶり反落、大証ヘラクレス指数が0.67％高と3日続伸。ジャスダック、東証マザーズ、大証ヘラクレスの主要3市場合計の出来高は7761万株、売買代金は376億円。騰落銘柄数は値上がり437銘柄、値下がり413銘柄。新高値20銘柄、新安値8銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%889%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressで特定タグの記事だけを表示</title>
		<link>http://baseviews.com/wordpress/show-only-certain-tags.html</link>
		<comments>http://baseviews.com/wordpress/show-only-certain-tags.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 15:54:24 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1886</guid>
		<description><![CDATA[WordPressで特定のタグがついたエントリだけを表示したい場合のやり方。ここを参考にさせていただいた。

やり方は特定カテゴリだけを表示する場合とほとんど同じ。query_posts()でタグを呼び出す。

query_posts('tag="タグ名"');

違うのはカテゴリを呼び出す場合にはカテゴリIDを指定するのに対し、タグの場合はIDではなくタグ名をそのまま書くこと。タグ名が日本語の場合もエンコードの必要はなく、日本語のままでも大丈夫だった。
表示数の指定はshowpost=n。10記事だけ表示したければshowposts=10。

query_posts('showposts=10&#038;tag="タグ名"');

で、こういう風にした。

&#60;ul&#62;
&#60;?php
　query_posts('showposts=10&#038;tag="タグ名"');
　while (have_posts()) : the_post();
　　echo '&#60;li&#62;&#60;a href="';
　　echo the_permalink();
　　echo '"&#62;';
　　echo the_title();
　　echo "&#60;/a&#62;&#60;/li&#62;";
　endwhile;
　wp_reset_query();
?&#62;
&#60;/ul&#62;

]]></description>
		<wfw:commentRss>http://baseviews.com/wordpress/show-only-certain-tags.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月8日の東京株式市場｜日経平均216円高、1月25日以来の1万500円台回復</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%888%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%888%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 14:55:06 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1880</guid>
		<description><![CDATA[<h2>東京株式市場概況</h2>
2010年3月8日の東京株式市場は日経平均株価が216円96銭高の1万585円92銭、TOPIXは16.5ポイント高の927.31ポイントと続伸。東証1部の出来高は18億9408万株、売買代金は1兆3508億円。騰落銘柄数は値上がり1225銘柄、値下がり313銘柄。25日騰落レシオは105.48％。新高値は49銘柄、新安値は3銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%888%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月8日の新興市場</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%888%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%888%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Mon, 08 Mar 2010 14:45:13 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1883</guid>
		<description><![CDATA[<h2>新興市場概況</h2>
2010年3月8日の新興市場は日経ジャスダック平均が0.47％高、東証マザーズ指数が0.77％高、大証ヘラクレス指数が0.63％高とそろって続伸。ジャスダック、東証マザーズ、大証ヘラクレスの主要3市場合計の出来高は2591万株、売買代金は408億円。騰落銘柄数は値上がり534銘柄、値下がり322銘柄。新高値28銘柄、新安値9銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%888%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月5日の新興市場｜エスクリが上場、初値後はストップ安</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%885%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%885%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:59:29 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1869</guid>
		<description><![CDATA[<h2>新興市場概況</h2>
2010年3月5日の新興市場は日経ジャスダック平均が0.23％高と3日ぶり反発、東証マザーズ指数が1.11％高と4日ぶり反発、大証ヘラクレス指数が0.74％高と4日ぶり反発。ジャスダック、東証マザーズ、大証ヘラクレスの主要3市場合計の出来高は2486万株、売買代金は432億円。騰落銘柄数は値上がり474銘柄、値下がり365銘柄。新高値18銘柄、新安値8銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%885%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月5日の東京株式市場｜日経平均223円高、日銀の追加金融緩和観測好感</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%885%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%885%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:56:40 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1866</guid>
		<description><![CDATA[<h2>東京株式市場概況</h2>
2010年3月5日の東京株式市場は日経平均株価が223円24銭高の1万368円96銭、TOPIXは13.17ポイント高の910.81ポイントと反発。東証1部の出来高は17億4718万株、売買代金は1兆2710億円。騰落銘柄数は値上がり1459銘柄、値下がり128銘柄。25日騰落レシオは95.05％。新高値は28銘柄、新安値は4銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%885%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月4日の新興市場｜アニコムが一時ストップ安</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%884%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%884%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:58:25 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1864</guid>
		<description><![CDATA[<h2>新興市場概況</h2>
2010年3月4日の新興市場は日経ジャスダック平均が0.09％安と続落、東証マザーズ指数が0.04％安と3日続落、大証ヘラクレス指数が0.55％安と3日続落。ジャスダック、東証マザーズ、大証ヘラクレスの主要3市場合計の出来高は1909万株、売買代金は389億円。騰落銘柄数は値上がり360銘柄、値下がり495銘柄。新高値13銘柄、新安値5銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%884%E6%97%A5%E3%81%AE%E6%96%B0%E8%88%88%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>［市況］2010年3月4日の東京株式市場｜日経平均107円安、後場急落</title>
		<link>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%884%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html</link>
		<comments>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%884%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:55:20 +0000</pubDate>
		<dc:creator>BaseViews</dc:creator>
				<category><![CDATA[市況]]></category>
		<category><![CDATA[日本株式市場]]></category>
		<category><![CDATA[株式市場]]></category>

		<guid isPermaLink="false">http://baseviews.com/?p=1861</guid>
		<description><![CDATA[<h2>東京株式市場概況</h2>
2010年3月4日の東京株式市場は日経平均株価が107円42銭安の1万145円72銭、TOPIXは8.01ポイント安の897.64ポイントと5日ぶり反落。東証1部の出来高は17億2080万株、売買代金は1兆1883億円。騰落銘柄数は値上がり334銘柄、値下がり1211銘柄。25日騰落レシオは91.7％。新高値は21銘柄、新安値は9銘柄。]]></description>
		<wfw:commentRss>http://baseviews.com/%E5%B8%82%E6%B3%81/3%E6%9C%884%E6%97%A5%E3%81%AE%E6%9D%B1%E4%BA%AC%E6%A0%AA%E5%BC%8F%E5%B8%82%E5%A0%B4.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
