<?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>WpFunc &#187; disable</title>
	<atom:link href="http://www.wpfunc.com/tag/disable/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpfunc.com</link>
	<description>Awesome, Quick, Simple WordPress Functions!</description>
	<lastBuildDate>Fri, 09 Jul 2010 09:05:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Disable Comments on 30-day older posts</title>
		<link>http://www.wpfunc.com/wordpress/disable-comments-on-30-day-older-posts.html</link>
		<comments>http://www.wpfunc.com/wordpress/disable-comments-on-30-day-older-posts.html#comments</comments>
		<pubDate>Sat, 18 Jul 2009 01:00:55 +0000</pubDate>
		<dc:creator>KaiseRCrazY</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[commenting]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[funcitons]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=45</guid>
		<description><![CDATA[Hi! I have a new function for you :) That one about commenting and automatically closing comments. We can disable commenting on posts older then 30 days. We will change functions.php. Be careful please.

For disable commenting we have to make changes in functions.php in our theme folder. First, you have to make a backup for [...]<hr /><div style="text-align:center;">
<a href="http://aweber.com/?339698" title="Email Marketing">
<img src="http://www.aweber.com/banners/email_marketing/468x60_an.gif" alt="Email Marketing $19/Month!" style="border:none;" /></a>
</div><hr />


Related posts:<ol><li><a href='http://www.wpfunc.com/wordpress/how-to-include-comments-in-posts-lists.html' rel='bookmark' title='Permanent Link: How to include comments in posts lists?'>How to include comments in posts lists?</a></li>
<li><a href='http://www.wpfunc.com/wordpress/you-can-disable-image-captions.html' rel='bookmark' title='Permanent Link: You can disable image captions!'>You can disable image captions!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/disable-caching.html' rel='bookmark' title='Permanent Link: Disable Caching!'>Disable Caching!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hi! I have a new function for you :) That one about commenting and automatically closing comments. We can disable commenting on posts older then 30 days. We will change <strong><em>functions.php</em></strong>. Be careful please.<span id="more-45"></span></p>
<p style="text-align: justify;"><span class="alert"><strong>With this function/recipe you will change your functions.php file located in your theme folder. If you have no information about WordPress coding -so you&#8217;re a newbie- you can get some support if you send a mail to me. Don&#8217;t touch your functions.php if you don&#8217;t know about WordPress</strong></span></p>
<p>For disable commenting we have to make changes in <strong><em><span style="color: #ff0000;">functions.php</span></em></strong> in our theme folder. First, you have to make a backup for this file. After backup open your <strong><em>functions.php with your favourite php editor</em></strong> and add code to here.</p>
<h3>Here is th code;</h3>
<pre class="brush: plain;">&lt; ?php
function close_comments( $posts ) {
if ( !is_single() ) { return $posts; }
if ( time() - strtotime( $posts[0]-&gt;post_date_gmt ) &gt; ( 30 * 24 * 60 * 60 ) ) {
$posts[0]-&gt;comment_status = 'closed';
$posts[0]-&gt;ping_status    = 'closed';
}
return $posts;
}
add_filter( 'the_posts', 'close_comments' );
?&gt;</pre>
<p>The <span style="color: #ff0000;"><em><strong>30</strong></em></span> is day. If you change this value you can change disabling time.</p>
<p>That&#8217;s All! Have a nice day!</p>
<a rel='nofollow' target='_blank'  href='http://delicious.com/post?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;title=Disable%20Comments%20on%2030-day%20older%20posts&amp;notes=Hi%21%20I%20have%20a%20new%20function%20for%20you%20%3A%29%20That%20one%20about%20commenting%20and%20automatically%20closing%20comments.%20We%20can%20disable%20commenting%20on%20posts%20older%20then%2030%20days.%20We%20will%20change%20functions.php.%20Be%20careful%20please.%0D%0A%0D%0AFor%20disable%20commenting%20we%20have%20to%20make%20chang'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/delicious.png' class='sociable-img sociable-hovers ' title='del.icio.us' alt='del.icio.us' /></a><a rel='nofollow' target='_blank'  href='http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;title=Disable%20Comments%20on%2030-day%20older%20posts&amp;bodytext=Hi%21%20I%20have%20a%20new%20function%20for%20you%20%3A%29%20That%20one%20about%20commenting%20and%20automatically%20closing%20comments.%20We%20can%20disable%20commenting%20on%20posts%20older%20then%2030%20days.%20We%20will%20change%20functions.php.%20Be%20careful%20please.%0D%0A%0D%0AFor%20disable%20commenting%20we%20have%20to%20make%20chang'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/digg.png' class='sociable-img sociable-hovers ' title='Digg' alt='Digg' /></a><a rel='nofollow' target='_blank'  href='http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;t=Disable%20Comments%20on%2030-day%20older%20posts'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/facebook.png' class='sociable-img sociable-hovers ' title='Facebook' alt='Facebook' /></a><a rel='nofollow' target='_blank'  href='http://www.friendfeed.com/share?title=Disable%20Comments%20on%2030-day%20older%20posts&amp;link=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/friendfeed.png' class='sociable-img sociable-hovers ' title='FriendFeed' alt='FriendFeed' /></a><a rel='nofollow' target='_blank'  href='http://reddit.com/submit?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;title=Disable%20Comments%20on%2030-day%20older%20posts'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/reddit.png' class='sociable-img sociable-hovers ' title='Reddit' alt='Reddit' /></a><a rel='nofollow' target='_blank'  href='http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;title=Disable%20Comments%20on%2030-day%20older%20posts'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png' class='sociable-img sociable-hovers ' title='StumbleUpon' alt='StumbleUpon' /></a><a rel='nofollow' target='_blank'  href='http://technorati.com/faves?add=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/technorati.png' class='sociable-img sociable-hovers ' title='Technorati' alt='Technorati' /></a><a rel='nofollow' target='_blank'  href='http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;partner=sociable'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/pdf.png' class='sociable-img sociable-hovers ' title='PDF' alt='PDF' /></a><a rel='nofollow' target='_blank'  href='http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.wpfunc.com%2Fwordpress%2Fdisable-comments-on-30-day-older-posts.html&amp;partner=sociable'><img src='http://www.wpfunc.com/wp-content/plugins/sociable-30/images/default/16/printfriendly.png' class='sociable-img sociable-hovers ' title='Print' alt='Print' /></a><br/><br/>

<p>Related posts:<ol><li><a href='http://www.wpfunc.com/wordpress/how-to-include-comments-in-posts-lists.html' rel='bookmark' title='Permanent Link: How to include comments in posts lists?'>How to include comments in posts lists?</a></li>
<li><a href='http://www.wpfunc.com/wordpress/you-can-disable-image-captions.html' rel='bookmark' title='Permanent Link: You can disable image captions!'>You can disable image captions!</a></li>
<li><a href='http://www.wpfunc.com/wordpress/disable-caching.html' rel='bookmark' title='Permanent Link: Disable Caching!'>Disable Caching!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wpfunc.com/wordpress/disable-comments-on-30-day-older-posts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
