<?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 on: Filter Categories from Homepage</title>
	<atom:link href="http://www.billerickson.net/thesis-wordpress-remove-category-homepage/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/</link>
	<description>WordPress Consulting</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:58:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kim Davis</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-6284</link>
		<dc:creator>Kim Davis</dc:creator>
		<pubDate>Wed, 16 Nov 2011 23:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-6284</guid>
		<description>Thank you, thank you. I finally got this to work!</description>
		<content:encoded><![CDATA[<p>Thank you, thank you. I finally got this to work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Erickson</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-4493</link>
		<dc:creator>Bill Erickson</dc:creator>
		<pubDate>Sun, 28 Aug 2011 02:13:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-4493</guid>
		<description>This should still work if your blog isn&#039;t the front page. is_home() applies to the blog page (whether or not it&#039;s your homepage), and is_front_page() applies to the static front page.</description>
		<content:encoded><![CDATA[<p>This should still work if your blog isn&#8217;t the front page. is_home() applies to the blog page (whether or not it&#8217;s your homepage), and is_front_page() applies to the static front page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-4492</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Sun, 28 Aug 2011 02:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-4492</guid>
		<description>Any idea how to make this work if the blog isn&#039;t your homepage? I have a static page at &#039;home&#039; and the blog at /blog.

Thanks!</description>
		<content:encoded><![CDATA[<p>Any idea how to make this work if the blog isn&#8217;t your homepage? I have a static page at &#8216;home&#8217; and the blog at /blog.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Erickson</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-2064</link>
		<dc:creator>Bill Erickson</dc:creator>
		<pubDate>Fri, 15 Apr 2011 22:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-2064</guid>
		<description>Thanks for catching that. I recently updated my site and went through all blog posts converting &lt; code &gt; and &lt; pre &gt; to the syntax highlighter above, and there&#039;s still a few posts with issues in them (like this). Hopefully I&#039;ll find all the issues soon.</description>
		<content:encoded><![CDATA[<p>Thanks for catching that. I recently updated my site and went through all blog posts converting < code > and < pre > to the syntax highlighter above, and there&#8217;s still a few posts with issues in them (like this). Hopefully I&#8217;ll find all the issues soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-2062</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Fri, 15 Apr 2011 22:39:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-2062</guid>
		<description>Oh, nevermind. I found this on another site, must have been a problem with my cut and paste of michael&#039;s code:

&lt;code&gt;
function exclude_cat($query) {
if ( $query-&gt;is_home) {
	$query-&gt; set(&#039;cat&#039;,&#039;-42&#039;);
	}
return $query;
}
add_filter(&#039;pre_get_posts&#039;,&#039;exclude_cat&#039;);
&lt;/code&gt;

Also, Bill, you have a code tag in your code, makes for errors on those copying and pasting into their php files ;-)</description>
		<content:encoded><![CDATA[<p>Oh, nevermind. I found this on another site, must have been a problem with my cut and paste of michael&#8217;s code:</p>
<p><code><br />
function exclude_cat($query) {<br />
if ( $query-&gt;is_home) {<br />
	$query-&gt; set('cat','-42');<br />
	}<br />
return $query;<br />
}<br />
add_filter('pre_get_posts','exclude_cat');<br />
</code></p>
<p>Also, Bill, you have a code tag in your code, makes for errors on those copying and pasting into their php files <img src='http://www.billerickson.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-2061</link>
		<dc:creator>Joshua</dc:creator>
		<pubDate>Fri, 15 Apr 2011 22:36:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-2061</guid>
		<description>I can&#039;t get this one to work, or Michael&#039;s solution either.

I&#039;ve entered this:
&lt;code&gt;
function home_filter_begin() {
	if(is_home()):
		global $wp_query;
		$exclude = &#039;-42&#039;;
		query_posts(array_merge(array(&#039;cat&#039; =&gt; $exclude ),$wp_query-&gt;query));
	endif;
}
add_action(&#039;thesis_hook_before_content&#039;,&#039;home_filter_begin&#039;);

function home_filter_end() {
	if(is_home()):
		wp_reset_query();
	endif;
}
add_action(&#039;thesis_hook_after_content&#039;,&#039;home_filter_end&#039;);
&lt;/code&gt;

And yes, that is the right ID for the category I want to exclude. Does it matter that I have a different blog page than my front page?</description>
		<content:encoded><![CDATA[<p>I can&#8217;t get this one to work, or Michael&#8217;s solution either.</p>
<p>I&#8217;ve entered this:<br />
<code><br />
function home_filter_begin() {<br />
	if(is_home()):<br />
		global $wp_query;<br />
		$exclude = '-42';<br />
		query_posts(array_merge(array('cat' =&gt; $exclude ),$wp_query-&gt;query));<br />
	endif;<br />
}<br />
add_action('thesis_hook_before_content','home_filter_begin');</p>
<p>function home_filter_end() {<br />
	if(is_home()):<br />
		wp_reset_query();<br />
	endif;<br />
}<br />
add_action('thesis_hook_after_content','home_filter_end');<br />
</code></p>
<p>And yes, that is the right ID for the category I want to exclude. Does it matter that I have a different blog page than my front page?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geneles</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-1773</link>
		<dc:creator>Michael Geneles</dc:creator>
		<pubDate>Sun, 20 Mar 2011 14:28:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-1773</guid>
		<description>&#039;pre_get_posts&#039; is a native WordPress filter. It runs before a query is executed in the main query or any instance of WP_Query, such as query_posts, get_posts, or get_children. Using &#039;pre_get_posts&#039; eliminates the need to use Thesis-specific / Genesis-specific hooks.

Cheers,
Michael</description>
		<content:encoded><![CDATA[<p>&#8216;pre_get_posts&#8217; is a native WordPress filter. It runs before a query is executed in the main query or any instance of WP_Query, such as query_posts, get_posts, or get_children. Using &#8216;pre_get_posts&#8217; eliminates the need to use Thesis-specific / Genesis-specific hooks.</p>
<p>Cheers,<br />
Michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Erickson</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-1772</link>
		<dc:creator>Bill Erickson</dc:creator>
		<pubDate>Sun, 20 Mar 2011 14:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-1772</guid>
		<description>Good catch. I should go through my older posts and update them sometime :)

This is the approach I take now too. This is also useful for controlling the number of posts that show up on a page (ex: if you have a Links post type and want 30 per page, but don&#039;t want 30 blog posts per page).</description>
		<content:encoded><![CDATA[<p>Good catch. I should go through my older posts and update them sometime <img src='http://www.billerickson.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This is the approach I take now too. This is also useful for controlling the number of posts that show up on a page (ex: if you have a Links post type and want 30 per page, but don&#8217;t want 30 blog posts per page).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Geneles</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-1771</link>
		<dc:creator>Michael Geneles</dc:creator>
		<pubDate>Sun, 20 Mar 2011 14:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-1771</guid>
		<description>Nice post Bill. There is also another, easier way to do this:

function exclude_cats_from_home($query) {
if ( $query-&gt;is_home) {
	$query-&gt; set(&#039;cat&#039;,&#039;-32&#039;);
	}
return $query;
}
add_filter(&#039;pre_get_posts&#039;,&#039;exclude_cats_from_home&#039;);</description>
		<content:encoded><![CDATA[<p>Nice post Bill. There is also another, easier way to do this:</p>
<p>function exclude_cats_from_home($query) {<br />
if ( $query-&gt;is_home) {<br />
	$query-&gt; set(&#8216;cat&#8217;,'-32&#8242;);<br />
	}<br />
return $query;<br />
}<br />
add_filter(&#8216;pre_get_posts&#8217;,'exclude_cats_from_home&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kaycee</title>
		<link>http://www.billerickson.net/thesis-wordpress-remove-category-homepage/comment-page-1/#comment-1716</link>
		<dc:creator>kaycee</dc:creator>
		<pubDate>Sat, 26 Feb 2011 14:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.billerickson.net/?p=1560#comment-1716</guid>
		<description>OMG Bill, ur a god! i had to separate my editorial stuff from the seriou stuff. U rock!!!
i love how u break the code down and xplain it!!!</description>
		<content:encoded><![CDATA[<p>OMG Bill, ur a god! i had to separate my editorial stuff from the seriou stuff. U rock!!!<br />
i love how u break the code down and xplain it!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

