<?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>Dazzling World 2 &#187; WordPress</title>
	<atom:link href="http://www.dazzlingworld2.com/category/memo/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dazzlingworld2.com</link>
	<description>に！</description>
	<lastBuildDate>Mon, 30 Jan 2012 12:13:26 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.dazzlingworld2.com/mephistopeles2/wp-content/themes/wikistyle/rss2.png</url>
		<title>Dazzling World 2 &#187; WordPress</title>
		<link>http://www.dazzlingworld2.com/</link>
	</image>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>_wp_unfiltered_html_comment replacer v0.1</title>
		<link>http://www.dazzlingworld2.com/post_5212.html</link>
		<comments>http://www.dazzlingworld2.com/post_5212.html#comments</comments>
		<pubDate>Sat, 04 Dec 2010 11:59:02 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[自作]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=5212</guid>
		<description><![CDATA[id属性”_wp_unfiltered_html_comment”の先頭のアンダーバーを除去するプラグイン。（ただし、手動） 有効化すると、ツールにwuhc_replacerが出来ます。 wuhc_replacer v0 [...]]]></description>
			<content:encoded><![CDATA[<p>id属性”_wp_unfiltered_html_comment”の先頭のアンダーバーを除去するプラグイン。（ただし、手動）</p>
<p>有効化すると、ツールにwuhc_replacerが出来ます。</p>
<p><a href="http://dazzlingworld2.com/uploads/file/wuhc_replacer.zip">wuhc_replacer v0.1</a></p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_5212.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_5212.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_5212.html&title=_wp_unfiltered_html_comment replacer v0.1">del.icio.us</a>
<br/>
Post tags: <br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li>関連記事はありません。</li>
	</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_5212.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>アップロードする画像の画質を上げる</title>
		<link>http://www.dazzlingworld2.com/post_5188.html</link>
		<comments>http://www.dazzlingworld2.com/post_5188.html#comments</comments>
		<pubDate>Sat, 04 Dec 2010 10:27:45 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=5188</guid>
		<description><![CDATA[WordPressで画像アップロードの際、サムネイルが作成されるわけなんだけど、このサムネイル微妙に画質が悪い！ 小さいと分かりにくいけど、うちは縦横600px位まで使うので、意外と目立つ。 と、云うことで画質上げ。 w [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressで画像アップロードの際、サムネイルが作成されるわけなんだけど、このサムネイル微妙に画質が悪い！<br />
小さいと分かりにくいけど、うちは縦横600px位まで使うので、意外と目立つ。<br />
と、云うことで画質上げ。</p>
<p>wp-include/media.phpの405行目に</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> image_resize<span style="color: #009900;">&#40;</span>
			<span style="color: #000088;">$file</span><span style="color: #339933;">,</span>
			<span style="color: #000088;">$max_w</span><span style="color: #339933;">,</span>
			<span style="color: #000088;">$max_h</span><span style="color: #339933;">,</span>
			<span style="color: #000088;">$crop</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
			<span style="color: #000088;">$suffix</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span>
			<span style="color: #000088;">$dest_path</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span>
			<span style="color: #000088;">$jpeg_quality</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">90</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr></table></div>

<p>というのがある。</p>
<p>この、$jpeg_quality = 90がjpgの画質。<br />
これを100にすれば一番良い画質になるんだけど、WordPressのバージョンアップ時に上書きされて90に戻ってしまう。<br />
それは面倒というか、100にするの忘れるのでテーマのfunctions.phpで対応することにする。<br />
プラグイン化も可能だけどね。</p>
<p>テーマのfunctions.phpに以下を追加</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* jpg画質up
*******************************************************************************/</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jpeg_quality'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_jpeg_quality'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> custom_jpeg_quality<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>あたりまえだけど、画質を上げるとファイルサイズも大きくなるので注意。</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_5188.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_5188.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_5188.html&title=アップロードする画像の画質を上げる">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/php" rel="tag">PHP</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_2289.html" title="コンフリクト！ (2009年7月11日)">コンフリクト！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4277.html" title="たまにはチェック (2010年5月29日)">たまにはチェック</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_3773.html" title="せっかく作ったので (2009年12月8日)">せっかく作ったので</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4222.html" title="WPAdsを使わない時のために (2010年5月22日)">WPAdsを使わない時のために</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4759.html" title="WordPressのホームページを変更する (2010年7月20日)">WordPressのホームページを変更する</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_5188.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>feedにアイコンを</title>
		<link>http://www.dazzlingworld2.com/post_5151.html</link>
		<comments>http://www.dazzlingworld2.com/post_5151.html#comments</comments>
		<pubDate>Sat, 04 Dec 2010 10:00:55 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=5151</guid>
		<description><![CDATA[feedにアバターというかアイコンというか、アイコンかな？ まぁ、ちょっとした画像を追加したかったんだ。 グーグル先生に聞いたらいい感じの答えが返ってきたので紹介。 wp-include/fedd-rss2.phpにコー [...]]]></description>
			<content:encoded><![CDATA[<p>feedにアバターというかアイコンというか、アイコンかな？<br />
まぁ、ちょっとした画像を追加したかったんだ。</p>
<p><a href="http://www.dazzlingworld2.com/post_5151.html/dw2010120401" rel="attachment wp-att-5183"><img src="http://www.dazzlingworld2.com/uploads/2010/12/dw2010120401-600x494.jpg" alt="dw2010120401 600x494 feedにアイコンを" title="フレッシュリーダー" width="600" height="494" class="alignnone size-medium wp-image-5183" /></a></p>
<p>グーグル先生に聞いたらいい感じの答えが返ってきたので紹介。</p>
<p>wp-include/fedd-rss2.phpにコードを追記すればいいみたい。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * RSS2 Feed Template for displaying RSS2 Posts feed.
 *
 * @package WordPress
 */</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: '</span> <span style="color: #339933;">.</span> feed_content_type<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rss-http'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'; charset='</span> <span style="color: #339933;">.</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blog_charset'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$more</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;?xml version=&quot;1.0&quot; encoding=&quot;'</span><span style="color: #339933;">.</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'blog_charset'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;?'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;rss version=&quot;2.0&quot;
	xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
	xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
	xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
	xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot;
	xmlns:sy=&quot;http://purl.org/rss/1.0/modules/syndication/&quot;
	xmlns:slash=&quot;http://purl.org/rss/1.0/modules/slash/&quot;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> do_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rss2_ns'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&gt;
&nbsp;
&lt;channel&gt;
	&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> wp_title_rss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;
	&lt;atom:link href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> self_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;self&quot; type=&quot;application/rss+xml&quot; /&gt;
	&lt;link&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/link&gt;
	&lt;description&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/description&gt;
	&lt;lastBuildDate&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> mysql2date<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'D, d M Y H:i:s +0000'</span><span style="color: #339933;">,</span> get_lastpostmodified<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GMT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/lastBuildDate&gt;
	&lt;language&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rss_language'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/language&gt;
	&lt;sy:updatePeriod&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'rss_update_period'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'hourly'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/sy:updatePeriod&gt;
	&lt;sy:updateFrequency&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'rss_update_frequency'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/sy:updateFrequency&gt;
	&lt;!-- コード追加開始 --&gt;
	&lt;image&gt;
		&lt;url&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/rss2.png&lt;/url&gt;
		&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> wp_title_rss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;
		&lt;link&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> bloginfo_rss<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>/&lt;/link&gt;
	&lt;/image&gt;
	&lt;!-- コード追加終了 --&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> do_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rss2_head'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;item&gt;
		&lt;title&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title_rss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/title&gt;
		&lt;link&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink_rss<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/link&gt;</pre></td></tr></table></div>

<p>ただ、wordpressのバージョンアップの度に編集するハメになるので、編集しなくていいようにfeed用テンプレートを作る。</p>
<p>使用ているテーマフォルダにあるfunctions.phpに以下コードを追加</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* feed用テンプレート
*******************************************************************************/</span>
remove_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed_rss2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'do_feed_rss2'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'do_feed_rss2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_feed_rss2'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> custom_feed_rss2<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$for_comments</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$template_file</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/feed-rss2'</span> <span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$for_comments</span> ? <span style="color: #0000ff;">'-comments'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$template_file</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span> get_template_directory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_file</span> <span style="color: #009900;">&#41;</span>
        ? get_template_directory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">:</span> ABSPATH <span style="color: #339933;">.</span> WPINC
        <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$template_file</span><span style="color: #339933;">;</span>
    load_template<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$template_file</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>そして、テーマフォルダにwp-include/fedd-rss2.phpをコピーすれば、テーマフォルダ内のfedd-rss2.phpをテンプレートとして使用するようになる。<br />
画像ファイルはテーマフォルダにrss2.pngで置いておく。</p>
<p>ちなみに、変更が反映されるのはアクセスした時じゃなくて、feed内の文章に変更が発生した時(投稿など)です。</p>
<p>参考：<br />
<a href="http://wordpress.p-mission.net/wordpress/wordpress-rss20.html">wordpressのRSS2.0をプチカスタマイズ &#8211; ひかげStyle</a><br />
<a href="http://dogmap.jp/2009/04/30/switching-feed-template/">各種フィード用テンプレートの変更 : dogmap.jp</a></p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_5151.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_5151.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_5151.html&title=feedにアイコンを">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/php" rel="tag">PHP</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_2289.html" title="コンフリクト！ (2009年7月11日)">コンフリクト！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_5188.html" title="アップロードする画像の画質を上げる (2010年12月4日)">アップロードする画像の画質を上げる</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4277.html" title="たまにはチェック (2010年5月29日)">たまにはチェック</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_3773.html" title="せっかく作ったので (2009年12月8日)">せっかく作ったので</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4222.html" title="WPAdsを使わない時のために (2010年5月22日)">WPAdsを使わない時のために</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_5151.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressのホームページを変更する</title>
		<link>http://www.dazzlingworld2.com/post_4759.html</link>
		<comments>http://www.dazzlingworld2.com/post_4759.html#comments</comments>
		<pubDate>Mon, 19 Jul 2010 22:16:28 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4759</guid>
		<description><![CDATA[WordPressをwordpressディレクトリにインストールすると、ホームページが/wordpress/index.phpになって、ちょっとURLが不格好になる。 こんな感じに。 http://awgnirzard. [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressをwordpressディレクトリにインストールすると、ホームページが/wordpress/index.phpになって、ちょっとURLが不格好になる。</p>
<p>こんな感じに。</p>
<p>http://awgnirzard.dynalias.com/wordpress/</p>
<p>そこで、インストールしたディレクトリ以外の場所をホームにして、ちょっとURLの見栄えを良くしよう。</p>
<p>こんな感じに。</p>
<p>http://awgnirzard.dynalias.com/</p>
<h3>やり方</h3>
<h4>1.index.phpを設置する。</h4>
<p>wordpressディレクトリの中にあるindex.phpをwordpressディレクトリと同じ階層(最上層ディレクトリ)にコピーする。</p>
<p>コピーしたindex.phpを変更する。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_USE_THEMES'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** Loads the WordPress Environment and Template */</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'./wordpress/wp-blog-header.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>wp-blog-header.phpはindex.phpと同じ階層でなく、wordpressディレクトリの中にあるので&#8221;/wordpress&#8221;を追加する。</p>
<h4>2.WordPressの設定を変更する</h4>
<p>管理画面 -> 設定 -> 一般のサイトのアドレス (URL)を変更する。</p>
<p>例<br />
変更前：http://awgnirzard.dynalias.com/wordpress<br />
変更後：http://awgnirzard.dynalias.com<br />
※最後に &#8216;/&#8217; は要らないようです。</p>
<p>「変更を保存」を押下。</p>
<h4>3.ページ確認</h4>
<p>管理画面の左上のブログタイトルをクリックして、変更したURLでホームページが表示されることを確認する。</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4759.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4759.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4759.html&title=WordPressのホームページを変更する">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/php" rel="tag">PHP</a>, <a href="http://www.dazzlingworld2.com/tags/wordpress" rel="tag">WordPress</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_4277.html" title="たまにはチェック (2010年5月29日)">たまにはチェック</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_2289.html" title="コンフリクト！ (2009年7月11日)">コンフリクト！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_5188.html" title="アップロードする画像の画質を上げる (2010年12月4日)">アップロードする画像の画質を上げる</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_3773.html" title="せっかく作ったので (2009年12月8日)">せっかく作ったので</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4247.html" title="こっち見んな！ (2010年5月29日)">こっち見んな！</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4759.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressのインストール</title>
		<link>http://www.dazzlingworld2.com/post_4733.html</link>
		<comments>http://www.dazzlingworld2.com/post_4733.html#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:43:37 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[インストール]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4733</guid>
		<description><![CDATA[動作環境のチェック WordPressをサーバーにインストールする前に、動作環境をチェックする。 動作環境は WordPress 日本語版 2.9 以降 　・PHP バージョン 4.3 以上 　・MySQL バージョン  [...]]]></description>
			<content:encoded><![CDATA[<h3>動作環境のチェック</h3>
<p>WordPressをサーバーにインストールする前に、動作環境をチェックする。<br />
動作環境は</p>
<p>WordPress 日本語版 2.9 以降<br />
　・PHP バージョン 4.3 以上<br />
　・MySQL バージョン 4.1.2 以上</p>
<p>です。</p>
<p>PHP、MySQLのバージョンは各レンタルサーバーで確認するか、index.phpに</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;?php phpinfo(); ?&gt;</pre></td></tr></table></div>

<p>を記述して確認して下さい。<br />
※確認後はphpinfoを記述したファイルは削除すること。</p>
<h3>MySQLデータベース作成</h3>
<p>MySQLにデータベースを作成します。<br />
各レンタルサーバーのデータベース作成方法に沿って作成してください。<br />
データベース名、ユーザー名、パスワードは忘れないように。</p>
<p>自前の人用</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="text" style="font-family:monospace;"># mysql -u root -p
Enter password: (パスワード入力)
&nbsp;
// awgnirzardデータベースを作成
mysql&gt; create database awgnirzard;
Query OK, 1 row affected (0.11 sec)
&nbsp;
// awgnirzardデータベースにアクセス出来るwordpressユーザーを作成
mysql&gt; grant all privileges on awgnirzard.* to wordpress@localhost identified by 'パスワード';
Query OK, 0 rows affected (0.12 sec)
&nbsp;
mysql&gt; exit
Bye</pre></td></tr></table></div>

<h3>WordPressインストール</h3>
<p><a href="http://ja.wordpress.org/">WordPress | 日本語</a>よりファイルをダウンロード解凍後、wordpressディレクトリをサーバーへアップロード。<br />
サーバーへSSHで接続できる人はwgetしてunzipすると速いよ。</p>
<p><a href="http://www.dazzlingworld2.com/uploads/2010/07/dw2010071401.jpg"><img src="http://www.dazzlingworld2.com/uploads/2010/07/dw2010071401-550x389.jpg" alt="dw2010071401 550x389 WordPressのインストール" title="WordPressアップロード" width="550" height="389" class="alignnone size-medium wp-image-4741" /></a></p>
<h3>WordPressコンフィグの設定</h3>
<p>wordpressディレクトリの下のwp-config-sample.phpをコピーして、ファイル名をwp-config.phpに変更して編集する。<br />
データベースを作成したときに設定した、データベース名、ユーザー名、パスワードを入力して、アップロード。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">// ** MySQL 設定 - こちらの情報はホスティング先から入手してください。 ** //
/** WordPress のためのデータベース名 */
define('DB_NAME', 'データベース名');
&nbsp;
/** MySQL データベースのユーザー名 */
define('DB_USER', 'ユーザー名');
&nbsp;
/** MySQL データベースのパスワード */
define('DB_PASSWORD', 'パスワード');</pre></td></tr></table></div>

<h3>WordPress初期設定</h3>
<p>基本的な所の準備ができたのでブログ名等を設定するためにhttp://サーバー名/wordpress/へアクセスする。</p>
<p><a href="http://www.dazzlingworld2.com/uploads/2010/07/dw2010071402.jpg"><img src="http://www.dazzlingworld2.com/uploads/2010/07/dw2010071402-488x550.jpg" alt="dw2010071402 488x550 WordPressのインストール" title="WordPress初期設定画面" width="488" height="550" class="alignnone size-medium wp-image-4744" /></a></p>
<p>サイトのタイトル、ユーザー名、パスワード、メールアドレスを入力して「WordPressをインストール」ボタンを押下する。<br />
<span style="color: #FF0000;">※設定したメールアドレスに完了通知メールが送信されてくるので、ちゃんと存在するアドレスを入力すること。</span></p>
<p>もう一度、http://サーバー名/wordpress/へアクセスし、ブログがちゃんと作成されているか確認する。</p>
<p>管理画面へログイン出来ることも確認するために、http://サーバー名/wordpress/wp-login.phpへアクセスし、先程設定したユーザー名とパスワードでログインする。</p>
<p>以上でインストール完了です。</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4733.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4733.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4733.html&title=WordPressのインストール">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/wordpress" rel="tag">WordPress</a>, <a href="http://www.dazzlingworld2.com/tags/%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab" rel="tag">インストール</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_4277.html" title="たまにはチェック (2010年5月29日)">たまにはチェック</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4247.html" title="こっち見んな！ (2010年5月29日)">こっち見んな！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4759.html" title="WordPressのホームページを変更する (2010年7月20日)">WordPressのホームページを変更する</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4255.html" title="WordPressに403を (2010年5月29日)">WordPressに403を</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4987.html" title="WindowsにApacheをインストール (2010年10月26日)">WindowsにApacheをインストール</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4733.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>たまにはチェック</title>
		<link>http://www.dazzlingworld2.com/post_4277.html</link>
		<comments>http://www.dazzlingworld2.com/post_4277.html#comments</comments>
		<pubDate>Sat, 29 May 2010 03:10:11 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ハック]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4277</guid>
		<description><![CDATA[たまにはAnother HTML-lint gatewayでチェックしてみる。 98点だった。 さて、修正するか。 たまにはチェック の続きを読む © Dazzling World 2, 2010. &#124; Permalin [...]]]></description>
			<content:encoded><![CDATA[<p>たまには<a href="http://openlab.ring.gr.jp/k16/htmllint/htmllint.html">Another  HTML-lint gateway</a>でチェックしてみる。</p>
<p>98点だった。</p>
<p>さて、修正するか。<br />
<br/>
<a href="http://www.dazzlingworld2.com/post_4277.html">たまにはチェック</a> の続きを読む</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4277.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4277.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4277.html&title=たまにはチェック">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/php" rel="tag">PHP</a>, <a href="http://www.dazzlingworld2.com/tags/wordpress" rel="tag">WordPress</a>, <a href="http://www.dazzlingworld2.com/tags/%e3%83%8f%e3%83%83%e3%82%af" rel="tag">ハック</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_4759.html" title="WordPressのホームページを変更する (2010年7月20日)">WordPressのホームページを変更する</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_2289.html" title="コンフリクト！ (2009年7月11日)">コンフリクト！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_5188.html" title="アップロードする画像の画質を上げる (2010年12月4日)">アップロードする画像の画質を上げる</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_3773.html" title="せっかく作ったので (2009年12月8日)">せっかく作ったので</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_889.html" title="すたいるしーとはっく (2009年2月9日)">すたいるしーとはっく</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4277.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPressに403を</title>
		<link>http://www.dazzlingworld2.com/post_4255.html</link>
		<comments>http://www.dazzlingworld2.com/post_4255.html#comments</comments>
		<pubDate>Sat, 29 May 2010 00:16:29 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[403]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[HTTPエラーページ]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4255</guid>
		<description><![CDATA[WordPressはテーマに404.phpがあると、404エラーの時404ページを表示してくれる。 /index.php?error=404 上記にアクセスすると、404ページが表示されるわけだが… ?error=404 [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressはテーマに404.phpがあると、404エラーの時404ページを表示してくれる。</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/index.php?error=404</pre></div></div>

<p>上記にアクセスすると、404ページが表示されるわけだが…<br />
?error=404ってどう見てもGETパラメータである。<br />
ということは、だ。<br />
403にしたら、403ページが表示できるようになるんじゃないか？<br />
<br/>
<a href="http://www.dazzlingworld2.com/post_4255.html">WordPressに403を</a> の続きを読む</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4255.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4255.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4255.html&title=WordPressに403を">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/403" rel="tag">403</a>, <a href="http://www.dazzlingworld2.com/tags/apache" rel="tag">Apache</a>, <a href="http://www.dazzlingworld2.com/tags/http%e3%82%a8%e3%83%a9%e3%83%bc%e3%83%9a%e3%83%bc%e3%82%b8" rel="tag">HTTPエラーページ</a>, <a href="http://www.dazzlingworld2.com/tags/wordpress" rel="tag">WordPress</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_4247.html" title="こっち見んな！ (2010年5月29日)">こっち見んな！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4277.html" title="たまにはチェック (2010年5月29日)">たまにはチェック</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4759.html" title="WordPressのホームページを変更する (2010年7月20日)">WordPressのホームページを変更する</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4733.html" title="WordPressのインストール (2010年7月14日)">WordPressのインストール</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4987.html" title="WindowsにApacheをインストール (2010年10月26日)">WindowsにApacheをインストール</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4255.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>こっち見んな！</title>
		<link>http://www.dazzlingworld2.com/post_4247.html</link>
		<comments>http://www.dazzlingworld2.com/post_4247.html#comments</comments>
		<pubDate>Fri, 28 May 2010 22:38:59 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[サーバー]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4247</guid>
		<description><![CDATA[WordPressの管理ページがある/wp-adminに機械的にアクセスがあったので拒否る事にする。 /wp-admin以下に.htaccessを設置する。 そして中身を下記のようにする。 1 2 3 4 AllowOv [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressの管理ページがある/wp-adminに機械的にアクセスがあったので拒否る事にする。</p>
<p>/wp-admin以下に.htaccessを設置する。<br />
そして中身を下記のようにする。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">AllowOverride   Limit
Order           Deny,Allow
Deny from       All
Allow from      127.0.0.1 203.135.</pre></td></tr></table></div>

<p>1行目でアクセス制御を行うディレクティブ(Order, Allow, Deny)を有効にする。<br />
2行目でAllow(許可)とDeny(拒否)のどちらを先に評価するか設定。<br />
3行目で全て拒否。<br />
4行目で許可するIPを設定。<br />
上記では127.0.0.1(ループバックアドレス)と203.135.???.???を許可する。</p>
<p>許可されてないIPで接続して、403ページが表示されたらおｋ。<br />
っていうけど、許可されてないIPから接続するのって意外と難しいよね。<br />
<a href="http://www.cman.jp/network/support/http.html">ホームページテスト【外部からの表示確認】</a><br />
とかで確認するといいかも。</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4247.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4247.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4247.html&title=こっち見んな！">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/apache" rel="tag">Apache</a>, <a href="http://www.dazzlingworld2.com/tags/wordpress" rel="tag">WordPress</a>, <a href="http://www.dazzlingworld2.com/tags/%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc" rel="tag">サーバー</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_4255.html" title="WordPressに403を (2010年5月29日)">WordPressに403を</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4987.html" title="WindowsにApacheをインストール (2010年10月26日)">WindowsにApacheをインストール</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_1812.html" title="色々テスト (2009年7月4日)">色々テスト</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_3688.html" title="メンテナンスは大事です。（マジで！ (2009年11月22日)">メンテナンスは大事です。（マジで！</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_2447.html" title="プラグインと動作チェック (2009年7月13日)">プラグインと動作チェック</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4247.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPAdsを使わない時のために</title>
		<link>http://www.dazzlingworld2.com/post_4222.html</link>
		<comments>http://www.dazzlingworld2.com/post_4222.html#comments</comments>
		<pubDate>Sat, 22 May 2010 04:35:14 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[カスタマイズ]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4222</guid>
		<description><![CDATA[広告等をランダム表示できるプラグインWPAdsをテーマに組み込んでいて、その組み込んだゾーンが空になった場合、何も出力されなくなるので、空divになってしまったり、テーマが崩れる事があるので、その対策。 wpadsはpr [...]]]></description>
			<content:encoded><![CDATA[<p>広告等をランダム表示できるプラグイン<a href="http://thesandbox.wordpress.com/wpads/">WPAds</a>をテーマに組み込んでいて、その組み込んだゾーンが空になった場合、何も出力されなくなるので、空divになってしまったり、テーマが崩れる事があるので、その対策。</p>
<p>wpadsはprint文が書いてあるだけなので、wpadsの中で呼んでるget_wpadsを使う。<br />
get_wpadsだとhtmlを返してくれるので、これを変数に入れてissetで中身が入ってるかどうかがわかる。</p>
<p>うちの場合はこんな感じ。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$wpads</span> <span style="color: #339933;">=</span> get_wpads<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'header'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wpads</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;ad&quot;&gt;
    &lt;div id=&quot;ad_inner&quot;&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$wpads</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;/div&gt;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>get_wpads(&#8216;header&#8217;)の結果を変数$wpadsに代入。<br />
変数$wpadsが空じゃなかったら、周りのdiv要素とechoで変数$wpadsの中身を出力。</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4222.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4222.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4222.html&title=WPAdsを使わない時のために">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/html" rel="tag">HTML</a>, <a href="http://www.dazzlingworld2.com/tags/php" rel="tag">PHP</a>, <a href="http://www.dazzlingworld2.com/tags/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3" rel="tag">プラグイン</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_4206.html" title="uptime!! v0.3 (2010年5月15日)">uptime!! v0.3</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4177.html" title="uptime!! v0.2 (2010年5月9日)">uptime!! v0.2</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4166.html" title="uptime!! (2010年5月8日)">uptime!!</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_2642.html" title="Another HTML-lintで100点を目指せ (2009年7月18日)">Another HTML-lintで100点を目指せ</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_465.html" title="ランダムイメージ (2008年12月20日)">ランダムイメージ</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4222.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ウィジェットでPHPを実行する -Executable PHP widget-</title>
		<link>http://www.dazzlingworld2.com/post_4219.html</link>
		<comments>http://www.dazzlingworld2.com/post_4219.html#comments</comments>
		<pubDate>Fri, 21 May 2010 11:01:23 +0000</pubDate>
		<dc:creator>だかね</dc:creator>
				<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://www.dazzlingworld2.com/?p=4219</guid>
		<description><![CDATA[WordPressのウィジェットは、手軽にサイドバーにテキストやHTMLを追加できるけど、PHPが実行できない！ PHPが実行できたらもっと便利！ わざわざ、テーマにPHP追加しなくてよくなるしね。 ってことで、ウィジェ [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressのウィジェットは、手軽にサイドバーにテキストやHTMLを追加できるけど、PHPが実行できない！</p>
<p>PHPが実行できたらもっと便利！<br />
わざわざ、テーマにPHP追加しなくてよくなるしね。</p>
<p>ってことで、ウィジェットでPHPが実行できるプラグインを追加。</p>
<p><a href="http://wordpress.org/extend/plugins/php-code-widget/">WordPress › PHP Code Widget « WordPress Plugins</a></p>
<p>インストールして有効化するとウィジェットに「PHP Code」が追加される。<br />
これに思う存分PHPを書きなぐれば、実行結果がサイドバーに表示されてｳﾏｰ。</p>
<p>今回、ウィジェットでPHP実行して何がしたかったかというと、<a href="http://thesandbox.wordpress.com/wpads/">WPAds</a>をウィジェットで表示させること。<br />
サイドバーに広告をﾋﾞﾛｰﾝと何個も表示させるのは見苦しいのでな。</p>
<hr />
<p><small>© <a href="http://www.dazzlingworld2.com">Dazzling World 2</a>, 2010. |
<a href="http://www.dazzlingworld2.com/post_4219.html">Permalink</a> |
<a href="http://www.dazzlingworld2.com/post_4219.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.dazzlingworld2.com/post_4219.html&title=ウィジェットでPHPを実行する -Executable PHP widget-">del.icio.us</a>
<br/>
Post tags: <a href="http://www.dazzlingworld2.com/tags/%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3" rel="tag">プラグイン</a><br/>
</small></p>
	<h3>関連記事</h3>
	<ul class="st-related-posts">
	<li><a href="http://www.dazzlingworld2.com/post_465.html" title="ランダムイメージ (2008年12月20日)">ランダムイメージ</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4321.html" title="ページランクを右下に (2010年6月3日)">ページランクを右下に</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4222.html" title="WPAdsを使わない時のために (2010年5月22日)">WPAdsを使わない時のために</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4206.html" title="uptime!! v0.3 (2010年5月15日)">uptime!! v0.3</a></li>
	<li><a href="http://www.dazzlingworld2.com/post_4177.html" title="uptime!! v0.2 (2010年5月9日)">uptime!! v0.2</a></li>
</ul>


<p><small>Feed enhanced by <a href='http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/'>Better Feed</a> from  <a href='http://planetozh.com/blog/'>Ozh</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dazzlingworld2.com/post_4219.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

