<?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>Wed, 23 May 2012 10:39:01 +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>How to automatically add a class to body_class if there’s a sidebar</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/f8jfpIAsagg/how-to-automatically-add-a-class-to-body_class-if-theres-a-sidebar</link>
		<comments>http://www.wprecipes.com/how-to-automatically-add-a-class-to-body_class-if-theres-a-sidebar#comments</comments>
		<pubDate>Wed, 23 May 2012 10:39:01 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[body_class]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3088</guid>
		<description><![CDATA[By default, the body_class() function adds some class to the &#60;body&#62; tag to allow you to style your site more easily. But unfortunely, no extra class is added when your template has a sidebar. Here is a imple function to solve this problem.]]></description>
			<content:encoded><![CDATA[<p>To apply the hack, just paste the code below into your <em>functions.php</em> file.</p>
<pre>
function wpfme_has_sidebar($classes) {
    if (is_active_sidebar(&#39;sidebar&#39;)) {
        // add &#39;class-name&#39; to the $classes array
        $classes[] = &#39;has_sidebar&#39;;
    }
    // return the $classes array
    return $classes;
}
add_filter(&#39;body_class&#39;,&#39;wpfme_has_sidebar&#39;);
</pre>
<p><strong><em>Thanks to <a href="http://www.wpfunction.me/">WP Function</a> for the tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/f8jfpIAsagg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-automatically-add-a-class-to-body_class-if-theres-a-sidebar/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-automatically-add-a-class-to-body_class-if-theres-a-sidebar</feedburner:origLink></item>
		<item>
		<title>WP Theme Generator giveaway!</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/Fhl7Gw_5bgo/wp-theme-generator-giveaway</link>
		<comments>http://www.wprecipes.com/wp-theme-generator-giveaway#comments</comments>
		<pubDate>Fri, 18 May 2012 07:08:42 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[contest]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3079</guid>
		<description><![CDATA[Who do not like free stuff? Today, I'm glad to announce a new giveaway on WPRecipes: Enter the contest and try to win 5 WP Theme Generator licences. The only thing you have to do is to tweet about WP Theme Generator.]]></description>
			<content:encoded><![CDATA[<h2>How to enter the giveaway</h2>
<p>To enter, simply tweet anything including our partner url: http://www.wpthemegenerator.com. Then, leave a comment on this page so I'll have your email address. In one week (May 25), I'll pick 5 winners using <a href="http://www.random.org">Random.org</a> and they'll receive their prizes directly from the WP Theme Generator staff.</p>
<h2>Some more info about WP Theme Generator</h2>
<p><a href="http://www.wpthemegenerator.com/" target="_blank">WordPress Theme Generator</a> is a master tool to create and design custom themes, for it comprises more than 1000 design elements at your disposal and supports your own uploaded designs if so you wish. Additionally you can download all your themes –with a full-of-features framework– or save them for later review or edition, both in WP or HTML, and while they are being kept within the tool’s interface, they are kept up-to-date with the latest framework releases. If time is of the essence and an even faster solution is required there's a <a href="http://www.wpthemegenerator.com/gallery/" target="_blank">public themes gallery</a> which has hundreds of professionally pre-designed themes that include layered .psd files.</p>
<p><strong>WordPress Theme Generator main features</strong></p>
<ul type="disc">
<li>1000+ Pre-designed elements</li>
<li>New design elements added daily</li>
<li>Change any design aspect with an easy to use interface</li>
<li>50+ preloaded fonts to to choose from</li>
<li>Unlimited sidebars or widget areas</li>
<li>Saving, editing and downloading of the themes</li>
<li>Download in both WP &amp; HTML/CSS</li>
<li>Always updated with the latest WP version</li>
<li>A powerful framework behind</li>
<li><a href="http://www.wpthemegenerator.com/features/" target="_blank">Check all features</a></li>
</ul>
<p> Take a look to  the <a href="http://www.wpthemegenerator.com/" target="_blank">WordPress Theme Generator.</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/Fhl7Gw_5bgo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wp-theme-generator-giveaway/feed</wfw:commentRss>
		<slash:comments>29</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wp-theme-generator-giveaway</feedburner:origLink></item>
		<item>
		<title>How to automatically create meta description from content</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/AAChRYwwEMM/how-to-automatically-create-meta-description-from-content</link>
		<comments>http://www.wprecipes.com/how-to-automatically-create-meta-description-from-content#comments</comments>
		<pubDate>Wed, 16 May 2012 17:02:53 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3075</guid>
		<description><![CDATA[By default, WordPress do not add a &#60;meta description&#62; tag to your blog. While not necessary, some SEO experts insists that this tag is important for your site SEO. So what about generating one using your post content? Here is a cool piece of code to do it easily.]]></description>
			<content:encoded><![CDATA[<p>Paste the following code into your <em>functions.php</em> file:</p>
<pre>
function create_meta_desc() {
    global $post;
if (!is_single()) { return; }
    $meta = strip_tags($post-&gt;post_content);
    $meta = strip_shortcodes($post-&gt;post_content);
    $meta = str_replace(array(&quot;\n&quot;, &quot;\r&quot;, &quot;\t&quot;), &#39; &#39;, $meta);
    $meta = substr($meta, 0, 125);
    echo &quot;&lt;meta name=&#39;description&#39; content=&#39;$meta&#39; /&gt;&quot;;
}
add_action(&#39;wp_head&#39;, &#39;create_meta_desc&#39;);
</pre>
<p><strong><em>Thanks to <a href="http://www.paulund.co.uk/automatically-create-meta-description-from-content">Paul</a> for this handy snippet!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/AAChRYwwEMM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-automatically-create-meta-description-from-content/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-automatically-create-meta-description-from-content</feedburner:origLink></item>
		<item>
		<title>How to Remove the Width and Height Attributes From WP Image Uploader</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/0fvUwQXyFAo/how-to-remove-the-width-and-height-attributes-from-wp-image-uploader</link>
		<comments>http://www.wprecipes.com/how-to-remove-the-width-and-height-attributes-from-wp-image-uploader#comments</comments>
		<pubDate>Tue, 08 May 2012 14:07:24 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[images]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3070</guid>
		<description><![CDATA[When you upload images via WordPress image uploader and insert it into your posts, WordPress automatically include the image width and height attributes in the html &#60;img&#62; tag. But when using a responsible theme, this can cause lots of trouble. Here's a quick recipe to get rid of those attributes.]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following code into your theme <em>functions.php</em>:</p>
<pre>
add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 );
add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 );

function remove_width_attribute( $html ) {
   $html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
   return $html;
}
</pre>
<p><strong><em>Thanks to <a href="http://wpdailybits.com/blog/remove-the-width-and-height-attributes-from-wp-image-uploader/539">Damien</a> for the cool hack!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/0fvUwQXyFAo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-remove-the-width-and-height-attributes-from-wp-image-uploader/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-remove-the-width-and-height-attributes-from-wp-image-uploader</feedburner:origLink></item>
		<item>
		<title>How to test if a plugin is active</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/-zwrV38K3FA/how-to-test-if-a-plugin-is-active</link>
		<comments>http://www.wprecipes.com/how-to-test-if-a-plugin-is-active#comments</comments>
		<pubDate>Fri, 04 May 2012 13:02:25 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3066</guid>
		<description><![CDATA[When developing a WordPress theme, you often want to rely on a plugin. For example, I have seen many themes which relied on the Wp-PageNavi plugin for their pagination. But if the end user do not have the plugin installed, the code is broken and you can't use the theme. Happily, there's a WP function named is_plugin_active() that you can use to test if a plugin is active.  ]]></description>
			<content:encoded><![CDATA[<p>Nothing complicated: Simply paste the code below where you need to test if a specific plugin is active. Don't forget to update the plugin path on line 2!</p>
<pre>
&lt;?php
   if (is_plugin_active(&#39;plugin-directory/plugin-file.php&#39;)) {
      // the plugin is active
   }
?&gt;
</pre>
<p><strong><em>Thanks to <a href="http://www.catswhocode.com/blog/snippets">Cats Who Code</a> for the cool tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/-zwrV38K3FA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-test-if-a-plugin-is-active/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-test-if-a-plugin-is-active</feedburner:origLink></item>
		<item>
		<title>How to redirect users to a random post</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/MqbAm5YBYFQ/how-to-redirect-users-to-a-random-post</link>
		<comments>http://www.wprecipes.com/how-to-redirect-users-to-a-random-post#comments</comments>
		<pubDate>Mon, 30 Apr 2012 13:27:59 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[page template]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3060</guid>
		<description><![CDATA[What about giving a new life to your old posts by creating a page template that will redirect readers to a random post? Today, I'm going to show you how to easily create this kind of page.]]></description>
			<content:encoded><![CDATA[<p>Create a new file and name it <em>page-random.php</em>. Paste the code below in it:</p>
<pre>
// set arguments for get_posts()
$args = array(
    &#39;numberposts&#39; =&gt; 1,
    &#39;orderby&#39; =&gt; &#39;rand&#39;
);

// get a random post from the database
$my_random_post = get_posts ( $args );

// process the database request through a foreach loop
foreach ( $my_random_post as $post ) {
  // redirect the user to the random post
  wp_redirect ( get_permalink ( $post-&gt;ID ) );
  exit;
}</pre>
<p>Once done, upload the <em>page-random.php</em> file to your theme directory. Then, login to your WordPress dashboard and create a new page, called "random" (You have to call it <em>random</em>, otherwise, the standard page layout will apply, see <a href="http://codex.wordpress.org/Template_Hierarchy#Page_display">WP Codex</a> for more details about page hierarchy). </p>
<p>After you published the random page, any user who'll visit the <em>http://www.yourwebsite.com/random</em> page will be automatically redirected to a random post.</p>
<p><strong>By the way, I just created a <a href="http://www.facebook.com/pages/Cats-Who-Code/302807633129400">Facebook page for my websites</a> (This include WPRecipes as well as <a href="http://www.catswhocode.com">CatsWhoCode</a>) so don't hesitate to "like" it!<br />
</strong><br />
<strong><em>Thanks to <a href="http://wp.smashingmagazine.com/2012/04/19/random-redirection-in-wordpress/">Smashing Magazine</a> for the cool tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/MqbAm5YBYFQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-redirect-users-to-a-random-post/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-redirect-users-to-a-random-post</feedburner:origLink></item>
		<item>
		<title>How to disable plugin updates on your WordPress blog</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/0eX7s0H-kUM/how-to-disable-plugin-updates-on-your-wordpress-blog</link>
		<comments>http://www.wprecipes.com/how-to-disable-plugin-updates-on-your-wordpress-blog#comments</comments>
		<pubDate>Tue, 24 Apr 2012 15:10:33 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3057</guid>
		<description><![CDATA[By default, WordPress automatically checks if plugins updates are available, and if yes, ask you to install it. It is useful in most cases, but when building websites for clients you may not want them to updates plugins, for example if you modified a plugin especially for them. Here is an easy way to disable plugin updates on any WordPress blog. ]]></description>
			<content:encoded><![CDATA[<p>Nothing complicated: Simply paste the following code into your functions.php, save it, and you're done.</p>
<pre>
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
</pre>
<p><strong><em>Thanks to <a href="http://wp-snippets.com/disable-plugin-updates/">WP Snippets</a> for the useful tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/0eX7s0H-kUM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-disable-plugin-updates-on-your-wordpress-blog/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-disable-plugin-updates-on-your-wordpress-blog</feedburner:origLink></item>
		<item>
		<title>How to change the “posts” label to “articles”</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/Az0_AsXxRMI/how-to-change-the-posts-label-to-articles</link>
		<comments>http://www.wprecipes.com/how-to-change-the-posts-label-to-articles#comments</comments>
		<pubDate>Mon, 16 Apr 2012 14:59:09 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dashboard]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3052</guid>
		<description><![CDATA[Are you working for clients which aren't very good with technology? If yes, most of them might find the term "post" a bit confusing, while "article" can be seen as much self-explanatory. Today, I'm going to show you how you can easily change the "post" label to "articles".]]></description>
			<content:encoded><![CDATA[<p>Nothing complicated: Open your <em>functions.php</em> file, paste the code below in it. Save the file, and you're done!</p>
<pre>
add_filter('gettext',  'change_post_to_article');
add_filter('ngettext',  'change_post_to_article');

function change_post_to_article($translated) {
     $translated = str_ireplace('Post',  'Article',  $translated);
     return $translated;
}</pre>
<p><strong><em>Thanks to <a href="http://wp.smashingmagazine.com/2011/05/10/new-wordpress-power-tips-for-template-developers-and-consultants/">Smashing Magazine</a> for the cool tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/Az0_AsXxRMI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-change-the-posts-label-to-articles/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-change-the-posts-label-to-articles</feedburner:origLink></item>
		<item>
		<title>Easy WordPress pagination without plugins</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/6TAkda3F3kI/easy-wordpress-pagination-without-plugins</link>
		<comments>http://www.wprecipes.com/easy-wordpress-pagination-without-plugins#comments</comments>
		<pubDate>Fri, 06 Apr 2012 10:52:32 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[pages]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3046</guid>
		<description><![CDATA[WP-PageNavi is definitely one of the most popular WordPress plugins and in fact, it is very useful. But did you know that since version 2.1, WordPress had a built-in function called paginate_links(), which can be used to create to paginate your blog without using any plugin? Today, let's see how to use this handy function to create a pagination for your WordPress blog.]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following code where you want to display your pagination:</p>
<pre>
global $wp_query;
$total = $wp_query-&gt;max_num_pages;
// only bother with the rest if we have more than 1 page!
if ( $total &gt; 1 )  {
     // get the current page
     if ( !$current_page = get_query_var(&#39;paged&#39;) )
          $current_page = 1;
     // structure of "format" depends on whether we're using pretty permalinks
     $format = empty( get_option(&#39;permalink_structure&#39;) ) ? &#39;&amp;page=%#%&#39; : &#39;page/%#%/&#39;;
     echo paginate_links(array(
          &#39;base&#39; =&gt; get_pagenum_link(1) . &#39;%_%&#39;,
          &#39;format&#39; =&gt; $format,
          &#39;current&#39; =&gt; $current_page,
          &#39;total&#39; =&gt; $total,
          &#39;mid_size&#39; =&gt; 4,
          &#39;type&#39; =&gt; &#39;list&#39;
     ));
}
</pre>
<p><strong><em>Thanks to <a href="http://wp.smashingmagazine.com/2011/05/10/new-wordpress-power-tips-for-template-developers-and-consultants/">Smashing Magazine</a> for the cool tip!</em></strong> </p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/6TAkda3F3kI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/easy-wordpress-pagination-without-plugins/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/easy-wordpress-pagination-without-plugins</feedburner:origLink></item>
		<item>
		<title>Prevent WordPress to compress your jpg images</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/efMi8UMRYMg/prevent-wordpress-to-compress-your-jpg-images</link>
		<comments>http://www.wprecipes.com/prevent-wordpress-to-compress-your-jpg-images#comments</comments>
		<pubDate>Fri, 30 Mar 2012 17:24:28 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[images]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3042</guid>
		<description><![CDATA[By default, WordPress compress uploaded jpg images. This is a good thing because it makes the files smaller, but in some case, image quality can be more important. If you need to prevent WordPress to compress your images, simply apply this simple tip.  ]]></description>
			<content:encoded><![CDATA[<p>Open your functions.php file and paste the code below in it:</p>
<pre>add_filter('jpeg_quality', function($arg){return 100;});</pre>
<p>Save the file, and you're done. That's simple as that!</p>
<p><strong><em>Thanks to <a href="http://wp-snippets.com/keep-wordpress-from-compressing-jpgs/">WP Snippets</a> for the tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/efMi8UMRYMg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/prevent-wordpress-to-compress-your-jpg-images/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/prevent-wordpress-to-compress-your-jpg-images</feedburner:origLink></item>
	</channel>
</rss>

