<?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>Tue, 08 May 2012 14:07:24 +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 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>0</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>2</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>4</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>
		<item>
		<title>WordPress tip: Get thumbnail url</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/lLkGNPwAKv8/wordpress-tip-get-thumbnail-url</link>
		<comments>http://www.wprecipes.com/wordpress-tip-get-thumbnail-url#comments</comments>
		<pubDate>Thu, 15 Mar 2012 18:24:59 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3038</guid>
		<description><![CDATA[Today, here's a snippet that gives you the ability to extract the source of the post thumbnail image. It is super useful if you need the post thumbnail url to use in your code.
]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following code on your theme file, within the loop.</p>
<pre>
&lt;?php
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id);
$image_url = $image_url[0];
?&gt;
</pre>
<p><strong><em>Thanks to <a href="http://wp-snippets.com/thumbnail-source/">WP Snippets</a> for the cool tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/lLkGNPwAKv8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-tip-get-thumbnail-url/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-tip-get-thumbnail-url</feedburner:origLink></item>
		<item>
		<title>WordPress tip: Replace excerpt ellipsis with post permalink</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/aU1IGdwDmOY/wordpress-tip-replace-excerpt-ellipsis-with-post-permalink</link>
		<comments>http://www.wprecipes.com/wordpress-tip-replace-excerpt-ellipsis-with-post-permalink#comments</comments>
		<pubDate>Mon, 05 Mar 2012 15:26:17 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[excerpt]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3036</guid>
		<description><![CDATA[Today, here is an useful snippet to replace the ellipsis [...] from the excerpt with a permalink to the post. ]]></description>
			<content:encoded><![CDATA[<p>Paste the following code into your <em>functions.php</em> file. Once saved, the tip will be applied to your blog.</p>
<pre>
function replace_excerpt($content) {
       return str_replace(&#39;[...]&#39;,
               &#39;... &lt;div class=&quot;more-link&quot;&gt;&lt;a href=&quot;&#39;. get_permalink() .&#39;&quot;&gt;Continue Reading&lt;/a&gt;&lt;/div&gt;&#39;,
               $content
       );
}
add_filter(&#39;the_excerpt&#39;, &#39;replace_excerpt&#39;);
</pre>
<p><strong><em>Thanks to <a href="http://css-tricks.com/snippets/wordpress/replace-excerpt-ellipsis-with-permalink/">CSS Tricks</a> for the great snippet!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/aU1IGdwDmOY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-tip-replace-excerpt-ellipsis-with-post-permalink/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-tip-replace-excerpt-ellipsis-with-post-permalink</feedburner:origLink></item>
		<item>
		<title>Mighty Deals contest winners!</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/iz8VpP7V1bI/mighty-deals-contest-winners</link>
		<comments>http://www.wprecipes.com/mighty-deals-contest-winners#comments</comments>
		<pubDate>Sat, 25 Feb 2012 11:54:17 +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=3031</guid>
		<description><![CDATA[Hi everyone! Last week I hosted a contest where readers can win a free deal of their choice from <a href="http://is.gd/mdeals">Mighty Deals</a>. Today, I'm very exited to announce the three winners.]]></description>
			<content:encoded><![CDATA[<p>Here we go: winners for the <a href="http://is.gd/mdeals">Mighty Deals</a> contest are:<br />
cinghaman@gmail.com<br />
benoit@....net<br />
kontakt@....pl </p>
<p>Your email is on the list? Congratulation, you won! Please <a href="http://www.wprecipes.com/contact">email me</a> the deal you want and I'll forward your email to the guys from Mighty Deals. They'll give you your free deal!</p>
<p>Thanks everyone for participating!</p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/iz8VpP7V1bI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/mighty-deals-contest-winners/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/mighty-deals-contest-winners</feedburner:origLink></item>
	</channel>
</rss>

