<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>WpRecipes.com</title>
	
	<link>http://www.wprecipes.com</link>
	<description>Daily recipes to cook with WordPress</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:46:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Wprecipes" /><feedburner:info uri="wprecipes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Wprecipes</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>WordPress function: Get category ID using category name</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/VIdiruShc68/wordpress-function-get-category-id-using-category-name</link>
		<comments>http://www.wprecipes.com/wordpress-function-get-category-id-using-category-name#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:46:09 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[category id]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2622</guid>
		<description><![CDATA[When coding a WordPress site, you often need to get a category ID. If you ever wanted to be able to get a category ID from the category name, then just read this recipe, I'm pretty sure you will like it.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-function-get-category-id-using-category-name">WordPress function: Get category ID using category name</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As usual, let's start by pasting the function in your <em>functions.php</em> file:</p>
<pre>
function get_category_id($cat_name){
	$term = get_term_by('name', $cat_name, 'category');
	return $term->term_id;
}
</pre>
<p>Once you saved the file, just call the function with your category name as a parameter. Example:</p>
<pre>
$category_ID = get_category_id('WordPress Tutorials');
</pre>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-function-get-category-id-using-category-name">WordPress function: Get category ID using category name</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/VIdiruShc68" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-function-get-category-id-using-category-name/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-function-get-category-id-using-category-name</feedburner:origLink></item>
		<item>
		<title>How to display your average feed readers</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/MwdxAzidUCo/how-to-display-your-average-feed-readers</link>
		<comments>http://www.wprecipes.com/how-to-display-your-average-feed-readers#comments</comments>
		<pubDate>Fri, 23 Jul 2010 09:23:12 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2615</guid>
		<description><![CDATA[Many bloggers are using Feedburner "chicklet" to display their subscribers count. If you want to be able to display the count for an average 7 days, here is a piece of code you're going to love.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/how-to-display-your-average-feed-readers">How to display your average feed readers</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As usual, the first thing to do is to paste the function in your <em>functions.php</em> file:</p>
<pre>
function get_average_readers($feed_id,$interval = 7){
	$today = date(&#39;Y-m-d&#39;, strtotime(&quot;now&quot;));
	$ago = date(&#39;Y-m-d&#39;, strtotime(&quot;-&quot;.$interval.&quot; days&quot;));
	$feed_url=&quot;https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=&quot;.$feed_id.&quot;&amp;dates=&quot;.$ago.&quot;,&quot;.$today;
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_URL, $feed_url);
	$data = curl_exec($ch);
	curl_close($ch);
	$xml = new SimpleXMLElement($data);
	$fb = $xml-&gt;feed-&gt;entry[&#39;circulation&#39;];

	$nb = 0;
	foreach($xml-&gt;feed-&gt;children() as $circ){
		$nb += $circ[&#39;circulation&#39;];
	}

	return round($nb/$interval);
}
</pre>
<p>Once done, you can call the function wherever you want in your theme files. Pass your Feedburner feed id as a parameter: </p>
<pre>
&lt;?php
$nb = get_average_readers(&#39;catswhocode&#39;);
echo &quot;I have &quot;.$nb.&quot; RSS readers&quot;;
?&gt;
</pre>
<p><strong><em>Code initially published on <a href="http://www.catswhoblog.com/how-to-get-a-more-relevant-feedburner-count">Cats Who Blog</a>.</em></strong></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/how-to-display-your-average-feed-readers">How to display your average feed readers</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/MwdxAzidUCo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-display-your-average-feed-readers/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-display-your-average-feed-readers</feedburner:origLink></item>
		<item>
		<title>Add categories or tags to post programatically</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/ZHm2kwVMAME/add-categories-or-tags-to-post-programatically</link>
		<comments>http://www.wprecipes.com/add-categories-or-tags-to-post-programatically#comments</comments>
		<pubDate>Mon, 19 Jul 2010 06:57:01 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2609</guid>
		<description><![CDATA[I recently shown you jow you can create a post or a comment programatically, which is very usefull when creating advanced WOrdPress themes or plugins. Today, let's have a look at another killer snippet: Add categories or tags to a posts, programatically.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/add-categories-or-tags-to-post-programatically">Add categories or tags to post programatically</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The first thing to do is to create an array of categories id. Once done, you simply have to use the <em>wp_set_object()</em> function, which take 3 parameters: The post id, an array of categories to add to the post, and the taxonomy type (category in this example).</p>
<pre>
$category_ids = array(4, 5, 6);
wp_set_object_terms( $post_id, $category_ids, 'category');
</pre>
<p>Adding tags to a post is extremely easy as well. The only difference with the code to add categories is the taxonomy "post_tag" instead of "category".</p>
<pre>
$tag_ids = array(7, 8, 9);
wp_set_object_terms( $post_id, $tag_ids, 'post_tag');
</pre>
<p><strong><em>Thanks to <a href="http://wpprogrammer.com/snippets/add-a-category-or-tag-to-a-post-programatically/">WPProgrammer</a> for this very cool snippet.</em></strong></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/add-categories-or-tags-to-post-programatically">Add categories or tags to post programatically</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/ZHm2kwVMAME" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/add-categories-or-tags-to-post-programatically/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/add-categories-or-tags-to-post-programatically</feedburner:origLink></item>
		<item>
		<title>Display dates as “time ago”, the easy way</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/VslIY6nQhTM/display-dates-as-time-ago-the-easy-way</link>
		<comments>http://www.wprecipes.com/display-dates-as-time-ago-the-easy-way#comments</comments>
		<pubDate>Mon, 05 Jul 2010 04:26:41 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2600</guid>
		<description><![CDATA[Want to display human readable dates on your blog, such as "Posted 6 days ago?" There's a lot of available functions to do so, but only a few people know that WordPress have its own built-in function to do that. <p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/display-dates-as-time-ago-the-easy-way">Display dates as &#8220;time ago&#8221;, the easy way</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To display human readable dates on your blog, you have to use the human_time_diff() function. The following piece of code will show a post date like "Posted 6 days ago".<br />
Paste it anywhere within the loop, save the file, and you're done.</p>
<pre>
Posted &lt;?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?&gt;
</pre>
<p><strong><em>Credits: <a href="http://www.phpsnippets.info/display-dates-as-time-ago">PHP Snippets</a>.</em></strong></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/display-dates-as-time-ago-the-easy-way">Display dates as &#8220;time ago&#8221;, the easy way</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/VslIY6nQhTM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/display-dates-as-time-ago-the-easy-way/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/display-dates-as-time-ago-the-easy-way</feedburner:origLink></item>
		<item>
		<title>How to programatically remove WordPress dashboard widgets</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/3DuXcyERdbg/how-to-programatically-remove-wordpress-dashboard-widgets</link>
		<comments>http://www.wprecipes.com/how-to-programatically-remove-wordpress-dashboard-widgets#comments</comments>
		<pubDate>Wed, 23 Jun 2010 10:35:30 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2585</guid>
		<description><![CDATA[Added in version 2.7, the Dashboard Widget API allow you to ad widgets to your WordPress admin dashboard. In this recipe, I'll show you how you can easily remove them programatically.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/how-to-programatically-remove-wordpress-dashboard-widgets">How to programatically remove WordPress dashboard widgets</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following into your functions.php file. The code will remove all dashboard widgets, so you should comment lines related to wigets you'd like to keep.</p>
<pre>
function remove_dashboard_widgets() {
	global $wp_meta_boxes;

	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;side&#39;][&#39;core&#39;][&#39;dashboard_quick_press&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;normal&#39;][&#39;core&#39;][&#39;dashboard_incoming_links&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;normal&#39;][&#39;core&#39;][&#39;dashboard_right_now&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;normal&#39;][&#39;core&#39;][&#39;dashboard_plugins&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;normal&#39;][&#39;core&#39;][&#39;dashboard_recent_drafts&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;normal&#39;][&#39;core&#39;][&#39;dashboard_recent_comments&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;side&#39;][&#39;core&#39;][&#39;dashboard_primary&#39;]);
	unset($wp_meta_boxes[&#39;dashboard&#39;][&#39;side&#39;][&#39;core&#39;][&#39;dashboard_secondary&#39;]);

}

if (!current_user_can(&#39;manage_options&#39;)) {
	add_action(&#39;wp_dashboard_setup&#39;, &#39;remove_dashboard_widgets&#39; );
}
</pre>
<p><strong><em>Thanks to <a href="http://noscope.com/journal/2010/03/wordpress-trick-remove-dashboard-widgets">NoScope</a> for this code!</em></strong></p>
<p><em>By the way, did you had a look to my latest post on <a href="http://www.catswhocode.com/blog/how-to-create-a-side-blog-with-wordpress-3-0">CatsWhoCode</a> about WP 3.0 custom post types?</em></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/how-to-programatically-remove-wordpress-dashboard-widgets">How to programatically remove WordPress dashboard widgets</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/3DuXcyERdbg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-programatically-remove-wordpress-dashboard-widgets/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-programatically-remove-wordpress-dashboard-widgets</feedburner:origLink></item>
		<item>
		<title>How to automatically create a custom field when a post is published</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/y77zNTOye5c/how-to-automatically-create-a-custom-field-when-a-post-is-published</link>
		<comments>http://www.wprecipes.com/how-to-automatically-create-a-custom-field-when-a-post-is-published#comments</comments>
		<pubDate>Tue, 15 Jun 2010 09:56:34 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[custom fields]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2578</guid>
		<description><![CDATA[Ever wanted to be able to automatically create a custom field with a value when a post (or page) is created? Then this snippet is for you.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/how-to-automatically-create-a-custom-field-when-a-post-is-published">How to automatically create a custom field when a post is published</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Paste the code below into your <em>functions.php</em> file. The only thing you have to do is to edit the cutsom field name on line 6.
<pre>
add_action('publish_page', 'add_custom_field_automatically');
add_action('publish_post', 'add_custom_field_automatically');
function add_custom_field_automatically($post_ID) {
	global $wpdb;
	if(!wp_is_post_revision($post_ID)) {
		add_post_meta($post_ID, 'field-name', 'custom value', true);
	}
}
</pre>
<p><strong><em>Thanks to <a href="http://wpcanyon.com/tipsandtricks/adding-a-custom-field-automatically-on-postpage-publish/">wpCanyon</a> for this cool tip!</em></strong></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/how-to-automatically-create-a-custom-field-when-a-post-is-published">How to automatically create a custom field when a post is published</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/y77zNTOye5c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-automatically-create-a-custom-field-when-a-post-is-published/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-automatically-create-a-custom-field-when-a-post-is-published</feedburner:origLink></item>
		<item>
		<title>WordPress hack: Display post thumbnail in your RSS feed</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/5IiHkoixqFE/wordpress-hack-display-post-thumbnail-in-your-rss-feed</link>
		<comments>http://www.wprecipes.com/wordpress-hack-display-post-thumbnail-in-your-rss-feed#comments</comments>
		<pubDate>Fri, 11 Jun 2010 09:36:34 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2575</guid>
		<description><![CDATA[Introduced in WordPress 2.9, get_the_post_thumbnail() allow you to display a thumbnail in your posts. But what about displaying post thumbnails in RSS feeds? Just read this recipe to know how to do.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-hack-display-post-thumbnail-in-your-rss-feed">WordPress hack: Display post thumbnail in your RSS feed</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following code in your functions.php file. The post thumbnail should be visible once you saved the file.</p>
<pre>
function diw_post_thumbnail_feeds($content) {
	global $post;
	if(has_post_thumbnail($post-&gt;ID)) {
		$content = &#39;&lt;div&gt;&#39; . get_the_post_thumbnail($post-&gt;ID) . &#39;&lt;/div&gt;&#39; . $content;
	}
	return $content;
}
add_filter(&#39;the_excerpt_rss&#39;, &#39;diw_post_thumbnail_feeds&#39;);
add_filter(&#39;the_content_feed&#39;, &#39;diw_post_thumbnail_feeds&#39;);
</pre>
<p><strong><em>Thanks to <a href="http://digwp.com/2010/06/show-post-thumbnails-in-feeds">Jeff Starr</a> for this great tip!</em></strong></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-hack-display-post-thumbnail-in-your-rss-feed">WordPress hack: Display post thumbnail in your RSS feed</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/5IiHkoixqFE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-hack-display-post-thumbnail-in-your-rss-feed/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-hack-display-post-thumbnail-in-your-rss-feed</feedburner:origLink></item>
		<item>
		<title>WordPress hack: Remove admin name in comments class</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/FKR1-Tmj9eY/wordpress-hack-remove-admin-name-in-comments-class</link>
		<comments>http://www.wprecipes.com/wordpress-hack-remove-admin-name-in-comments-class#comments</comments>
		<pubDate>Mon, 24 May 2010 05:50:39 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2567</guid>
		<description><![CDATA[By default, when the blog admin left a comment on his blog, WordPress use the name in the comment css class. This is useful for styling, but it will also let people know about your admin login name. If you want to hide this info, read this recipe.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-hack-remove-admin-name-in-comments-class">WordPress hack: Remove admin name in comments class</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This code simply have to be pasted in your <em>functions.php</em> file to work:</p>
<pre>
function remove_comment_author_class( $classes ) {
	foreach( $classes as $key =&gt; $class ) {
		if(strstr($class, &quot;comment-author-&quot;)) {
			unset( $classes[$key] );
		}
	}
	return $classes;
}
add_filter( &#39;comment_class&#39; , &#39;remove_comment_author_class&#39; );
</pre>
<p><strong><em>Thanks to <a href="http://bavotasan.com/tutorials/small-security-hole-in-wordpress-comments/">C. Bavota</a> for this interesting piece of code!</em></strong></p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-hack-remove-admin-name-in-comments-class">WordPress hack: Remove admin name in comments class</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/FKR1-Tmj9eY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-hack-remove-admin-name-in-comments-class/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-hack-remove-admin-name-in-comments-class</feedburner:origLink></item>
		<item>
		<title>WordPress tip: Automatically empty Trash</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/wT3SlI3_kMg/wordpress-tip-automatically-empty-trash</link>
		<comments>http://www.wprecipes.com/wordpress-tip-automatically-empty-trash#comments</comments>
		<pubDate>Thu, 20 May 2010 06:17:46 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[posts]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2561</guid>
		<description><![CDATA[Trash is a new functionality from WordPress 2.9. When an item (post, comment, etc) is deleted, it goes in Trash instead of being permanently removed. Here is a tip to tell your WordPress blog to autmatically empty trash every X days.<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-tip-automatically-empty-trash">WordPress tip: Automatically empty Trash</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Simply open your <em>wp-config.php</em> file (located at the root of your WOrdPress install) and paste the following code:</p>
<pre>define('EMPTY_TRASH_DAYS', 10 );</pre>
<p>The second parameter is when to empty trash, in days.</p>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-tip-automatically-empty-trash">WordPress tip: Automatically empty Trash</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/wT3SlI3_kMg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-tip-automatically-empty-trash/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-tip-automatically-empty-trash</feedburner:origLink></item>
		<item>
		<title>WordPress hack: Insert comments programatically</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/ATghfWg79j8/wordpress-hack-insert-comments-programatically</link>
		<comments>http://www.wprecipes.com/wordpress-hack-insert-comments-programatically#comments</comments>
		<pubDate>Mon, 17 May 2010 05:55:33 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[comments]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2553</guid>
		<description><![CDATA[Some time ago, I've shown you how to insert posts programatically in WordPress database. So now, what about comments? In this recipe I'll show you <p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-hack-insert-comments-programatically">WordPress hack: Insert comments programatically</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The following code can be pasted anywhere on your theme files.<br />
Once this code is executed, it will add a new comment into WordPress database. The returned value is the comment ID, or 0 if a problem happenned.</p>
<pre>
$data = array(
	'comment_post_ID' => 1,
	'comment_author' => 'admin',
	'comment_author_email' => 'admin@admin.com',
	'comment_author_url' => 'http://www.catswhocode.com',
	'comment_content' => 'Lorem ipsum dolor sit amet...',
	'comment_author_IP' => '127.0.0.1',
	'comment_agent' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3',
	'comment_date' => date('Y-m-d H:i:s'),
	'comment_date_gmt' => date('Y-m-d H:i:s'),
	'comment_approved' => 1,
);

$comment_id = wp_insert_comment($data);
</pre>
<p><em>Looking for WordPress hosting? Try <a href="http://www.catswhocode.com/blog/wpwebhost.html">WP Web Host</a>. Prices starts at $5/month and you can try it for free!<br/><br/><a href="http://www.wprecipes.com/wordpress-hack-insert-comments-programatically">WordPress hack: Insert comments programatically</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/ATghfWg79j8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-hack-insert-comments-programatically/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-hack-insert-comments-programatically</feedburner:origLink></item>
	</channel>
</rss>
