<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for GreenOrange Studios</title>
	<atom:link href="http://www.greenorangestudios.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.greenorangestudios.com</link>
	<description>Web design and development enthusiast with a touch of design</description>
	<lastBuildDate>Tue, 17 May 2011 00:30:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Brennan Thompson</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-82</link>
		<dc:creator>Brennan Thompson</dc:creator>
		<pubDate>Tue, 17 May 2011 00:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-82</guid>
		<description>Bingo that&#039;s it. Thanks.</description>
		<content:encoded><![CDATA[<p>Bingo that&#8217;s it. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by sebastien</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-81</link>
		<dc:creator>sebastien</dc:creator>
		<pubDate>Sat, 05 Mar 2011 23:20:37 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-81</guid>
		<description>your code comes from http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/
no ?</description>
		<content:encoded><![CDATA[<p>your code comes from <a href="http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/?referer=');">http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/</a><br />
no ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by student scholarship</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-55</link>
		<dc:creator>student scholarship</dc:creator>
		<pubDate>Sat, 25 Sep 2010 21:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-55</guid>
		<description>Great, I never knew this, thanks.</description>
		<content:encoded><![CDATA[<p>Great, I never knew this, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Wrozka Sybilla</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-34</link>
		<dc:creator>Wrozka Sybilla</dc:creator>
		<pubDate>Fri, 10 Sep 2010 04:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-34</guid>
		<description>Good info</description>
		<content:encoded><![CDATA[<p>Good info</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on WordPress 3.0 Release – Video by contraceptive sponge</title>
		<link>http://www.greenorangestudios.com/2010/06/17/wordpress-3-0-release-%e2%80%93-video/#comment-31</link>
		<dc:creator>contraceptive sponge</dc:creator>
		<pubDate>Thu, 09 Sep 2010 14:28:03 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=722#comment-31</guid>
		<description>Thanks for this information. I think someone need some help like this.</description>
		<content:encoded><![CDATA[<p>Thanks for this information. I think someone need some help like this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Zackary Mirabile</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-28</link>
		<dc:creator>Zackary Mirabile</dc:creator>
		<pubDate>Wed, 01 Sep 2010 19:24:33 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-28</guid>
		<description>Came across your web site via msn the other day and absolutely love it. Carry on the excellent work.</description>
		<content:encoded><![CDATA[<p>Came across your web site via msn the other day and absolutely love it. Carry on the excellent work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Brennan Thompson</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-25</link>
		<dc:creator>Brennan Thompson</dc:creator>
		<pubDate>Sun, 29 Aug 2010 04:04:26 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-25</guid>
		<description>Nice, such a smart idea. I never thought about that</description>
		<content:encoded><![CDATA[<p>Nice, such a smart idea. I never thought about that</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Mariano</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-24</link>
		<dc:creator>Mariano</dc:creator>
		<pubDate>Sat, 28 Aug 2010 07:45:55 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-24</guid>
		<description>Instead of this:
&lt;code&gt;
$array_of_post_types = array(&quot;custom_type01&quot;, &quot;custom_type02&quot;,&quot;custom_type03&quot;);
&lt;code&gt;

You could use this:
&lt;/code&gt;
$array_of_post_types = array_splice( get_post_types( array( &#039;exclude_from_search&#039; =&gt; false ), &#039;names&#039; ), 3 );
&lt;/code&gt;

You will define the template_redirect and add_new_rules only once for ALL the custom types you may have.</description>
		<content:encoded><![CDATA[<p>Instead of this:<br />
<code><br />
$array_of_post_types = array("custom_type01", "custom_type02","custom_type03");<br />
</code><code></p>
<p>You could use this:<br />
</code><br />
$array_of_post_types = array_splice( get_post_types( array( 'exclude_from_search' =&gt; false ), 'names' ), 3 );</p>
<p>You will define the template_redirect and add_new_rules only once for ALL the custom types you may have.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Jacob</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-10</link>
		<dc:creator>Jacob</dc:creator>
		<pubDate>Sun, 08 Aug 2010 07:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-10</guid>
		<description>That worked! Thanks.</description>
		<content:encoded><![CDATA[<p>That worked! Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Custom Post Type, Template Redirect the right way. by Brennan Thompson</title>
		<link>http://www.greenorangestudios.com/2010/05/27/custom-post-type-template-redirect-the-right-way/#comment-9</link>
		<dc:creator>Brennan Thompson</dc:creator>
		<pubDate>Sat, 07 Aug 2010 22:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://greenora.businesspromotioninc.com/?p=575#comment-9</guid>
		<description>Yes, if you create an array of custom post types as such:
&lt;pre&gt;$array_of_post_types = array(&quot;&quot;, &quot;&quot;,&quot;&quot;);&lt;/pre&gt;

The run a foreach loop on the array you could accomplish that task.

So your code would look similar to this:
&lt;pre&gt;
function add_new_rules()
	{
		global $wp_rewrite;
		
		$array_of_post_types = array(&quot;custom_type01&quot;, &quot;custom_type02&quot;,&quot;custom_type03&quot;);
		
		foreach($array_of_post_types as $type)
		{
		
			$rewrite_rules = $wp_rewrite-&gt;generate_rewrite_rules($type.&#039;/&#039;);
			$rewrite_rules[$type.&#039;/?$&#039;] = &#039;index.php?paged=1&#039;;
			
			foreach($rewrite_rules as $regex =&gt; $redirect)
			{
			   if(strpos($redirect, &#039;attachment=&#039;) === false)
			   {
			   $redirect .= &#039;&amp;post_type=&#039;.$type;
			   }
			   if(0 &lt; preg_match_all(&#039;@\$([0-9])@&#039;, $redirect, $matches))
			   {
					 for($i = 0; $i &lt; count($matches[0]); $i++)
					 {
						   $redirect = str_replace($matches[0][$i], &#039;$matches[&#039;.$matches[1][$i].&#039;]&#039;, $redirect);
					 }
			   }
			   $wp_rewrite-&gt;add_rule($regex, $redirect, &#039;top&#039;);
			}
		}
	
	}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Yes, if you create an array of custom post types as such:</p>
<pre>$array_of_post_types = array("", "","");</pre>
<p>The run a foreach loop on the array you could accomplish that task.</p>
<p>So your code would look similar to this:</p>
<pre>
function add_new_rules()
	{
		global $wp_rewrite;

		$array_of_post_types = array("custom_type01", "custom_type02","custom_type03");

		foreach($array_of_post_types as $type)
		{

			$rewrite_rules = $wp_rewrite->generate_rewrite_rules($type.'/');
			$rewrite_rules[$type.'/?$'] = 'index.php?paged=1';

			foreach($rewrite_rules as $regex => $redirect)
			{
			   if(strpos($redirect, 'attachment=') === false)
			   {
			   $redirect .= '&#038;post_type='.$type;
			   }
			   if(0 < preg_match_all('@\$([0-9])@', $redirect, $matches))
			   {
					 for($i = 0; $i < count($matches[0]); $i++)
					 {
						   $redirect = str_replace($matches[0][$i], '$matches['.$matches[1][$i].']', $redirect);
					 }
			   }
			   $wp_rewrite->add_rule($regex, $redirect, 'top');
			}
		}

	}
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

