<?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>Adsense &#8211; トモデジ  tomodigi.com</title>
	<atom:link href="https://tomodigi.com/tag/adsense/feed/" rel="self" type="application/rss+xml" />
	<link>https://tomodigi.com</link>
	<description>デジタルもアナログも</description>
	<lastBuildDate>Sun, 25 Sep 2011 06:14:57 +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>最新の記事にだけAdsense広告を表示する (WordPress)</title>
		<link>https://tomodigi.com/web/%e6%9c%80%e6%96%b0%e3%81%ae%e8%a8%98%e4%ba%8b%e3%81%ab%e3%81%a0%e3%81%91adsense%e5%ba%83%e5%91%8a%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b-wordpress/</link>
					<comments>https://tomodigi.com/web/%e6%9c%80%e6%96%b0%e3%81%ae%e8%a8%98%e4%ba%8b%e3%81%ab%e3%81%a0%e3%81%91adsense%e5%ba%83%e5%91%8a%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Tomo]]></dc:creator>
		<pubDate>Mon, 26 Sep 2011 06:13:24 +0000</pubDate>
				<category><![CDATA[WEB]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Adsense]]></category>
		<guid isPermaLink="false">http://www.tomodigi.com/?p=103</guid>

					<description><![CDATA[Google Adsenseの広告ユニットは1ページあたり3つまでと決められています。このサイトのように、記事を最新のものから複数個表示している場合、最初のいくつかの記事の下部にだけ広告を表示しています。 方法はこのサイ &#8230; <a href="https://tomodigi.com/web/%e6%9c%80%e6%96%b0%e3%81%ae%e8%a8%98%e4%ba%8b%e3%81%ab%e3%81%a0%e3%81%91adsense%e5%ba%83%e5%91%8a%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b-wordpress/" class="more-link">続きを読む <span class="screen-reader-text">最新の記事にだけAdsense広告を表示する (WordPress)</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Google Adsenseの広告ユニットは1ページあたり3つまでと決められています。このサイトのように、記事を最新のものから複数個表示している場合、最初のいくつかの記事の下部にだけ広告を表示しています。</p>
<p>方法は<a title="WordPressのトップページで、最新の記事だけ見せ方を変えたい" href="http://webetc.blog.shinobi.jp/Entry/228/">この</a>サイトを参考にしました。</p>
<p>まず、ダッシュボードから、メインインデックスのテンプレート(index.php)を選択します。<br />
その中で、記事を繰り返し表示している部分を探します。</p>
<pre>&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;</pre>
<p>このようになっているところを以下のように変更しました。</p>
<pre>&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $post_counter++;?&gt;</pre>
<p>そして、広告ユニットを入れたい場所を探します。</p>
<pre>&lt;?php if ($post_counter &lt;= 1) {
print &lt;&lt;&lt;EOD
&lt;script type
....
....
&lt;/script&gt;
EOD;</pre>
<p>そこに上記のように、取得したコードを print &lt;&lt;&lt;EODとEOD;の間に入れて、完成です。（EOD;の前にはスペース等を入れないよう注意。）</p>
<p>$post_counterの最大値を指定することで、広告の表示回数を変更することができます。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tomodigi.com/web/%e6%9c%80%e6%96%b0%e3%81%ae%e8%a8%98%e4%ba%8b%e3%81%ab%e3%81%a0%e3%81%91adsense%e5%ba%83%e5%91%8a%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
