<?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>560DESIGNS &#187; 制作メモ</title>
	<atom:link href="http://www.560designs.com/memo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.560designs.com</link>
	<description></description>
	<lastBuildDate>Thu, 10 May 2012 02:19:46 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>[WordPress] WordPress Popular Postsでカスタム投稿タイプも対象にする方法＋投稿IDだけ配列で取得する方法</title>
		<link>http://www.560designs.com/memo/776.html</link>
		<comments>http://www.560designs.com/memo/776.html#comments</comments>
		<pubDate>Thu, 12 Apr 2012 07:19:22 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=776&#038;post_type=memo</guid>
		<description><![CDATA[例えば、post_typeが「hoge1」と「hoge2」の投稿も含めたい場合。 まず、wordpress-popular-posts.phpの510行目（ver. 2.2.1） を とする。 これで「hoge1」と「h [...]]]></description>
			<content:encoded><![CDATA[<p>例えば、post_typeが「hoge1」と「hoge2」の投稿も含めたい場合。</p>
<p>まず、<strong>wordpress-popular-posts.php</strong>の510行目（ver. 2.2.1）</p>
<pre class="brush: php; title: ; notranslate">
	$nopages = &quot;AND $wpdb-&gt;posts.post_type = 'post'&quot;;
</pre>
<p>を</p>
<pre class="brush: php; title: ; notranslate">
	$nopages = &quot;AND $wpdb-&gt;posts.post_type IN ('post', 'hoge1', 'hoge2')&quot;;
</pre>
<p>とする。<br />
これで「hoge1」と「hoge2」も対象に含まれるようになる。</p>
<p>次に、<strong>wpp_get_mostpopular()</strong>で吐き出されるものでは柔軟にいじれないので、<strong>ob_start()</strong>で投稿IDだけ抜き出し、<strong>投稿IDの配列</strong>を生成する。</p>
<pre class="brush: php; title: ; notranslate">
	if ( function_exists( 'wpp_get_mostpopular' ) )
	{
		$args = array (
			'order_by' =&gt; 'views',// views=閲覧数, comments=コメント数
			'range' =&gt; 'all',// dialy=日間, weekly=週間, monthly=月間, all=総数
			'stats_comments' =&gt; 0,// コメント数表示
			'limit' =&gt; 10,
		);

		ob_start ();
		wpp_get_mostpopular( http_build_query ( $args ) );
		$output = ob_get_contents ();
		ob_end_clean ();

		preg_match_all ( '/([0-9]+)\.html/', $output, $result );
		$p_arr = $result[1];

		if ( count ( $p_arr ) &gt; 0 )
		{
			$args = array (
				'post_type' =&gt; array ( 'hoge1', 'hoge2' ),
				'post__in' =&gt; $p_arr,
			);
			query_posts( $args );

			if ( have_posts() )
			{
				while ( have_posts() )
				{
					the_post();
				}
				wp_reset_query();
			}
		}

	}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/776.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress] 同じDB（テーブルとそのレコード）を使って複数のWebサイトを構築する</title>
		<link>http://www.560designs.com/memo/487.html</link>
		<comments>http://www.560designs.com/memo/487.html#comments</comments>
		<pubDate>Thu, 02 Feb 2012 00:53:55 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=487&#038;post_type=memo</guid>
		<description><![CDATA[まず、普通にWordPressを実装します。仮にこれを「親サイト」とします。 これが親的なWebサイトになり、WordPressの管理ページはこのWebサイトのURLのものに一本化されます。 （それぞれのページにログイン [...]]]></description>
			<content:encoded><![CDATA[<p>まず、普通にWordPressを実装します。仮にこれを「<strong>親サイト</strong>」とします。<br />
これが親的なWebサイトになり、WordPressの管理ページはこのWebサイトのURLのものに一本化されます。<br />
（それぞれのページにログインページもあるし、管理ページも実質あることになるけどリダイレクトされる）</p>
<p>2つ目以降は、<strong>親サイト</strong>と同じDBを利用するため、同じ<strong>wp-config.php</strong>をコピーして使います。仮に「<strong>子サイト</strong>」とします。<br />
このままだと、<strong>the_permalink()</strong>等のURLが親サイトのドメインになっているため、<strong>フィルター</strong>でこれを置き換えます。<br />
例えば<strong>親サイト</strong>が「560designs.com」で、<strong>子サイト</strong>が「560miller.jp」なら、</p>
<pre class="brush: php; title: ; notranslate">
function my_filter_home_url( $home_url )
{
	$home_url = preg_replace( '/560designs\.com/' , '560miller.jp', $home_url);
	return $home_url;
}
add_filter( 'home_url', 'my_filter_home_url' );
</pre>
<p>と、<strong>function.php</strong>に追記します。</p>
<p>でもこれだとコメントが親サイトに一本化されてしまうし、他にも問題がありそうなので実行する場合は自己責任で。<br />
※バージョン 3.3.1で確認</p>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/487.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress] 記事のタイムスタンプを取得する</title>
		<link>http://www.560designs.com/memo/395.html</link>
		<comments>http://www.560designs.com/memo/395.html#comments</comments>
		<pubDate>Tue, 31 Jan 2012 01:10:01 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=395&#038;post_type=memo</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
echo get_the_time( 'U' );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/395.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JavaScript] &lt;th&gt;にDD_belatedPNG.jsをかけるとIE6でフリーズする</title>
		<link>http://www.560designs.com/memo/389.html</link>
		<comments>http://www.560designs.com/memo/389.html#comments</comments>
		<pubDate>Fri, 20 Jan 2012 04:01:20 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=389&#038;post_type=memo</guid>
		<description><![CDATA[表題のとおりの現象です。 確認はしてませんがたぶん&#60;td&#62;も同じです。 解決法は「こんなことはしない」です。]]></description>
			<content:encoded><![CDATA[<p>表題のとおりの現象です。<br />
確認はしてませんがたぶん&lt;td&gt;も同じです。<br />
解決法は「こんなことはしない」です。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/389.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[jQuery] SyntaxHighlighter 3.0.83 ブラシリスト</title>
		<link>http://www.560designs.com/memo/49.html</link>
		<comments>http://www.560designs.com/memo/49.html#comments</comments>
		<pubDate>Thu, 12 Jan 2012 13:11:43 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=49&#038;post_type=memo</guid>
		<description><![CDATA[リストは下記。 http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/]]></description>
			<content:encoded><![CDATA[<p>リストは下記。</p>
<p><a href="http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/" target="_blank">http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/49.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress] カスタム投稿タイプのカテゴリタクソノミーをstyle=noneで取得時の小さなバグ？</title>
		<link>http://www.560designs.com/memo/209.html</link>
		<comments>http://www.560designs.com/memo/209.html#comments</comments>
		<pubDate>Thu, 27 Oct 2011 06:03:21 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=209&#038;post_type=memo</guid>
		<description><![CDATA[カスタム投稿タイプのカテゴリタクソノミーを 「イベント｜キャンペーン｜お知らせ｜」 みたいに取得する必要があったので、 としたところ、 のように、どういうわけか、&#60;a&#62;のなかに&#60;br /&#62;が入って [...]]]></description>
			<content:encoded><![CDATA[<p><strong>カスタム投稿タイプ</strong>の<strong>カテゴリタクソノミー</strong>を<br />
「イベント｜キャンペーン｜お知らせ｜」<br />
みたいに取得する必要があったので、</p>
<pre class="brush: php; title: ; notranslate">
$args = array (
	'taxonomy' =&gt; $taxonomy,
	'style' =&gt; 'none'
);
wp_list_categories( $args );
</pre>
<p>としたところ、</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a href=&quot;/hoge/&quot; title=&quot;イベント&quot;&gt;イベント&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;/hoge/&quot; title=&quot;キャンペーン&quot;&gt;キャンペーン&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;/hoge/&quot; title=&quot;お知らせ&quot;&gt;お知らせ&lt;/a&gt;&lt;br /&gt;
</pre>
<p>のように、どういうわけか、&lt;a&gt;のなかに&lt;br /&gt;が入ってしまう。<br />
百歩譲ってそれならそれでいいんだけど、なぜか最後だけ&lt;a&gt;の外なのがものすごく気持ち悪い。しかもこれが理由で単純に&lt;br /&gt;を「｜」に置き換えではだめになる。</p>
<pre class="brush: php; title: ; notranslate">
$args = array (
	'taxonomy' =&gt; $taxonomy,
	'style' =&gt; 'none',
	'echo' =&gt; false
);
$category_txt = wp_list_categories( $args );
$category_txt = preg_replace ( '/&lt;br /&gt;/', '', $category_txt );
echo preg_replace ( '/(&lt;\/a&gt;)/', &quot;$1｜&quot;, $category_txt );
</pre>
<p>これなら<strong>get_terms</strong>の方がいいかも。</p>
<p>※ver. 3.1.4で確認。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/209.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WordPress] wp_get_archivesで取得したリストに「年」を入れる</title>
		<link>http://www.560designs.com/memo/216.html</link>
		<comments>http://www.560designs.com/memo/216.html#comments</comments>
		<pubDate>Wed, 19 Oct 2011 03:31:54 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=216&#038;post_type=memo</guid>
		<description><![CDATA[wp_get_archivesにはget_archives_linkっつーフックポイントが用意されているみたいなんで、 てな感じで解決。 今回は年別アーカイブだけなんで、単純に「&#60;/a&#62;」タグを「年&#60;/ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>wp_get_archives</strong>には<strong>get_archives_link</strong>っつーフックポイントが用意されているみたいなんで、</p>
<pre class="brush: php; title: ; notranslate">
function my_get_archives_link( $html )
{
	return preg_replace ( '/&lt;\/a&gt;/', '年&lt;/a&gt;', $html );
}
add_filter( 'get_archives_link', 'my_get_archives_link' );
</pre>
<p>てな感じで解決。<br />
今回は年別アーカイブだけなんで、単純に「&lt;/a&gt;」タグを「年&lt;/a&gt;」に置き換えました。</p>
<p>※ver. 3.1.4、3.2.1で同じ症状を確認</p>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/216.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[EC-CUBE] ログインしているかどうかを判定する</title>
		<link>http://www.560designs.com/memo/32.html</link>
		<comments>http://www.560designs.com/memo/32.html#comments</comments>
		<pubDate>Thu, 25 Aug 2011 06:31:13 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=32&#038;post_type=memo</guid>
		<description><![CDATA[/data/class/pages/LC_Page.php 関数 init に下記を追加。 ポイントとか名前も取得する時はこんな感じで。 こんな感じで条件分岐させる。]]></description>
			<content:encoded><![CDATA[<p><strong>/data/class/pages/LC_Page.php</strong><br />
関数 <strong>init</strong> に下記を追加。</p>
<pre class="brush: php; title: ; notranslate">
$objCustomer = new SC_Customer();
if ( $objCustomer-&gt;isLoginSuccess() )
{
	$this-&gt;tpl_login = true;
}
</pre>
<p>ポイントとか名前も取得する時はこんな感じで。</p>
<pre class="brush: php; title: ; notranslate">
$objCustomer = new SC_Customer();
if ( $objCustomer-&gt;isLoginSuccess() )
{
	$this-&gt;tpl_login = true;
	$this-&gt;tpl_user_point = $objCustomer-&gt;getValue( 'point' );
	$this-&gt;tpl_name1 = $objCustomer-&gt;getValue( 'name01' );
	$this-&gt;tpl_name2 = $objCustomer-&gt;getValue( 'name02' );
}
</pre>
<p>こんな感じで条件分岐させる。</p>
<pre class="brush: php; title: ; notranslate">
&lt;!--{if $tpl_login}--&gt;
ログインしている時の処理
&lt;!--{else}--&gt;
ログインしていない時の処理
&lt;!--{/if}--&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/32.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[WordPress] 続きを読む(more)を無視して全文表示する</title>
		<link>http://www.560designs.com/memo/218.html</link>
		<comments>http://www.560designs.com/memo/218.html#comments</comments>
		<pubDate>Thu, 11 Aug 2011 19:23:55 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=218&#038;post_type=memo</guid>
		<description><![CDATA[ループが始まる前に、]]></description>
			<content:encoded><![CDATA[<p>ループが始まる前に、</p>
<pre class="brush: php; title: ; notranslate">

$more = 1;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/218.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] サーバーのサイトパスを参照する</title>
		<link>http://www.560designs.com/memo/226.html</link>
		<comments>http://www.560designs.com/memo/226.html#comments</comments>
		<pubDate>Mon, 25 Jul 2011 03:11:00 +0000</pubDate>
		<dc:creator>560DESIGNS</dc:creator>
		
		<guid isPermaLink="false">http://www.560designs.com/?p=226&#038;post_type=memo</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
echo __file__;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.560designs.com/memo/226.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

