<?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: Programmatically Turn Off Comments in WordPress with Filter</title>
	<atom:link href="http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Mon, 30 Jan 2012 12:48:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: bseanvt</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-1542</link>
		<dc:creator>bseanvt</dc:creator>
		<pubDate>Wed, 10 Aug 2011 14:46:46 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-1542</guid>
		<description>i looked at your site. that may be a hard coded link in the loop in your index.php file. the code above won&#039;t take anything out if it&#039;s hard coded as html. only if it&#039;s being programmatically generated.?</description>
		<content:encoded><![CDATA[<p>i looked at your site. that may be a hard coded link in the loop in your index.php file. the code above won&#8217;t take anything out if it&#8217;s hard coded as html. only if it&#8217;s being programmatically generated.?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bseanvt</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-1541</link>
		<dc:creator>bseanvt</dc:creator>
		<pubDate>Wed, 10 Aug 2011 14:43:44 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-1541</guid>
		<description>that code assumes you&#039;re on the single.php view. the call to is_single() is where that happens. you could try is_home() or is_front_page() functions as well... or just get rid of the is_single() function entirely and just use in_category(&quot;Category Name&quot;) ...also, you can edit your theme templates to take out the html. have a pastie i can look at?</description>
		<content:encoded><![CDATA[<p>that code assumes you&#8217;re on the single.php view. the call to is_single() is where that happens. you could try is_home() or is_front_page() functions as well&#8230; or just get rid of the is_single() function entirely and just use in_category(&#8220;Category Name&#8221;) &#8230;also, you can edit your theme templates to take out the html. have a pastie i can look at?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivia</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-1540</link>
		<dc:creator>Olivia</dc:creator>
		<pubDate>Wed, 10 Aug 2011 03:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-1540</guid>
		<description>I used the exact code you provided (of course changing the category name) in my functions.php. Something interesting is happening now though. My homepage displays one comic (I use Comicpress, and the comics are where I want to have no comments), and right now there is an option to comment on the homepage comic despite using your code. However, when I click the comment link, it just brings me to the page of the post with comment options nowhere to be seen.</description>
		<content:encoded><![CDATA[<p>I used the exact code you provided (of course changing the category name) in my functions.php. Something interesting is happening now though. My homepage displays one comic (I use Comicpress, and the comics are where I want to have no comments), and right now there is an option to comment on the homepage comic despite using your code. However, when I click the comment link, it just brings me to the page of the post with comment options nowhere to be seen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bseanvt</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-1539</link>
		<dc:creator>bseanvt</dc:creator>
		<pubDate>Tue, 09 Aug 2011 18:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-1539</guid>
		<description>what didn&#039;t work? use paste.org and i&#039;ll take a look at the code</description>
		<content:encoded><![CDATA[<p>what didn&#8217;t work? use paste.org and i&#8217;ll take a look at the code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivia</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-1537</link>
		<dc:creator>Olivia</dc:creator>
		<pubDate>Tue, 09 Aug 2011 05:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-1537</guid>
		<description>Orrrrrrr I spoke too soon. Sigh...</description>
		<content:encoded><![CDATA[<p>Orrrrrrr I spoke too soon. Sigh&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivia</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-1536</link>
		<dc:creator>Olivia</dc:creator>
		<pubDate>Mon, 08 Aug 2011 22:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-1536</guid>
		<description>Thank you, I tried several other suggestions but this one finally worked!</description>
		<content:encoded><![CDATA[<p>Thank you, I tried several other suggestions but this one finally worked!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matt mcinvale</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-320</link>
		<dc:creator>matt mcinvale</dc:creator>
		<pubDate>Fri, 25 Mar 2011 20:44:51 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-320</guid>
		<description>hack or not, it works perfectly for me.</description>
		<content:encoded><![CDATA[<p>hack or not, it works perfectly for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://seanbehan.com/programming/programmatically-turn-off-comments-in-wordpress-with-filter/#comment-273</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sun, 26 Dec 2010 00:29:33 +0000</pubDate>
		<guid isPermaLink="false">http://seanbehan.com/?p=973#comment-273</guid>
		<description>YOU ARE THE MAN!

I came up with another way to disable comments by category with a filter, but it wasn&#039;t quite working because I use Disqus comments.  This is working perfectly though!

Here is the code I was using, just for reference:

&lt;code&gt;add_filter( &#039;comments_open&#039;, &#039;falso_commento&#039;, 1 );
function falso_commento() {
if ( in_category(&#039;underground&#039;) )
	return false;
else
	return true;	
}&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>YOU ARE THE MAN!</p>
<p>I came up with another way to disable comments by category with a filter, but it wasn&#8217;t quite working because I use Disqus comments.  This is working perfectly though!</p>
<p>Here is the code I was using, just for reference:</p>
<p><code>add_filter( 'comments_open', 'falso_commento', 1 );<br />
function falso_commento() {<br />
if ( in_category('underground') )<br />
	return false;<br />
else<br />
	return true;<br />
}</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

