<?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, 06 Jun 2013 17:22:54 +0000</lastBuildDate>
	<language>en-US</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 use WordPress shortcodes in theme files</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/ydThcmQJ51E/how-to-use-wordpress-shortcodes-in-theme-files</link>
		<comments>http://www.wprecipes.com/how-to-use-wordpress-shortcodes-in-theme-files#comments</comments>
		<pubDate>Thu, 06 Jun 2013 17:22:54 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[shortcodes]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3597</guid>
		<description><![CDATA[WordPress shortcodes are very useful and easy to use. But unfortunately, you can only shortcodes in post/page editor, not theme files. But there's a little trick to do it easily. Just read on! ]]></description>
				<content:encoded><![CDATA[<p>To use a shortcode in a theme file, simply use the <em>do_shortcode()</em> function as shown below:</p>
<pre>
&lt;?php echo do_shortcode(&quot;[your_shortcode]&quot;); ?&gt;
</pre>
<p>That's it. Super simple, and really useful at times!</p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/ydThcmQJ51E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-use-wordpress-shortcodes-in-theme-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-use-wordpress-shortcodes-in-theme-files</feedburner:origLink></item>
		<item>
		<title>Automatically link Twitter usernames in WordPress</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/gYmH8qDrbO8/automatically-link-twitter-usernames-in-wordpress</link>
		<comments>http://www.wprecipes.com/automatically-link-twitter-usernames-in-wordpress#comments</comments>
		<pubDate>Tue, 04 Jun 2013 16:02:30 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3600</guid>
		<description><![CDATA[Are you using Twitter a lot? Today's recipe is a cool piece of code to automatically link Twitter usernames on your posts, pages, and comments. ]]></description>
				<content:encoded><![CDATA[<p>Paste the code below into your functions.php file:</p>
<pre>
function twtreplace($content) {
	$twtreplace = preg_replace(&#39;/([^a-zA-Z0-9-_&amp;])@([0-9a-zA-Z_]+)/&#39;,&quot;$1&lt;a href=\&quot;http://twitter.com/$2\&quot; target=\&quot;_blank\&quot; rel=\&quot;nofollow\&quot;&gt;@$2&lt;/a&gt;&quot;,$content);
	return $twtreplace;
}

add_filter(&#39;the_content&#39;, &#39;twtreplace&#39;);   
add_filter(&#39;comment_text&#39;, &#39;twtreplace&#39;);
</pre>
<p>Once you saved the file all twitter usernames in posts and comments will automatically be linked to their Twitter profiles. Usernames have to be written under the form <em>@username</em>.</p>
<p><strong><em>Thanks to <a href="http://snipplr.com/view/70977/automatically-link-twitter-usernames-in-wordpress/">ederwp</a> for the tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/gYmH8qDrbO8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/automatically-link-twitter-usernames-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/automatically-link-twitter-usernames-in-wordpress</feedburner:origLink></item>
		<item>
		<title>Themes4all giveaway: LOTS of prizes to win!!</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/ytn-IEl7nGQ/themes4all-giveaway-lots-of-prizes-to-win</link>
		<comments>http://www.wprecipes.com/themes4all-giveaway-lots-of-prizes-to-win#comments</comments>
		<pubDate>Fri, 24 May 2013 14:00:51 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[query_posts]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3585</guid>
		<description><![CDATA[Here's our new contest! This time, our partners <a href="http://www.themes4all.com/">Themes4All</a> are giving away lots of premium themes and plugins to 5 lucky winners. Read on to know how you can join the contest and try to win one of the packages gave by Themes4All.com!]]></description>
				<content:encoded><![CDATA[<h2>A word about Themes4All</h2>
<p>Our sponsor is <a href="http://is.gd/themes4all">Themes4All.com</a>, which is a newcomer in the  WordPress premium theme business. They specialize in low cost/high quality themes.<br />
They already released 20+ themes, each priced $10. Click <a href="http://www.themes4all.com/gallery">here</a> to view the available themes.</p>
<h2>How to join the giveaway?</h2>
<p>Joining the giveaway is super easy and free as usual. First, go to <a href="http://is.gd/themes4all">Themes4All.com</a> and create a free account. Registration grant you access to a free theme each month. Once done, simply leave a comment on this post to join.<br />
In two weeks (June 7, 2013) I'll pick 5 winners using random.org. </p>
<p>Winners will get:<br />
1. 4 template of your choice  + premium beta responsive parallax slider<br />
2. 3 template of your choice  + premium beta responsive parallax slider<br />
3. 2 template of your choice  + premium beta responsive parallax slider<br />
4. 1 template of your choice  + premium beta responsive parallax slider<br />
5. premium beta responsive parallax slider</p>
<p>If you won, you'll receive your prize by email, directly by <a href="http://www.themes4all.com/">Themes4All</a> staff. Now, good luck everyone!</p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/ytn-IEl7nGQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/themes4all-giveaway-lots-of-prizes-to-win/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/themes4all-giveaway-lots-of-prizes-to-win</feedburner:origLink></item>
		<item>
		<title>How to automatically insert a list of related articles below the post</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/PSQLJCD5CYk/how-to-automatically-insert-a-list-of-related-articles-below-the-post</link>
		<comments>http://www.wprecipes.com/how-to-automatically-insert-a-list-of-related-articles-below-the-post#comments</comments>
		<pubDate>Thu, 23 May 2013 14:32:59 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hook]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3581</guid>
		<description><![CDATA[When a reader finished reading one of your blog posts, why not suggesting him other article he might like as well? Here's a quick tip to automatically display related posts (based on category) below the current post.]]></description>
				<content:encoded><![CDATA[<p>First, paste the code below into the <em>functions.php</em> file from your theme. </p>
<pre>
// &quot;More from This Category&quot; list by Barış &#220;nver @ Wptuts+
function wptuts_more_from_cat( $title = &quot;More From This Category:&quot; ) {
    global $post;
    // We should get the first category of the post
    $categories = get_the_category( $post-&gt;ID );
    $first_cat = $categories[0]-&gt;cat_ID;
    // Let&#39;s start the $output by displaying the title and opening the &lt;ul&gt;
    $output = &#39;&lt;div id=&quot;more-from-cat&quot;&gt;&lt;h3&gt;&#39; . $title . &#39;&lt;/h3&gt;&#39;;
    // The arguments of the post list!
    $args = array(
        // It should be in the first category of our post:
        &#39;category__in&#39; =&gt; array( $first_cat ),
        // Our post should NOT be in the list:
        &#39;post__not_in&#39; =&gt; array( $post-&gt;ID ),
        // ...And it should fetch 5 posts - you can change this number if you like:
        &#39;posts_per_page&#39; =&gt; 5
    );
    // The get_posts() function
    $posts = get_posts( $args );
    if( $posts ) {
        $output .= &#39;&lt;ul&gt;&#39;;
        // Let&#39;s start the loop!
        foreach( $posts as $post ) {
            setup_postdata( $post );
            $post_title = get_the_title();
            $permalink = get_permalink();
            $output .= &#39;&lt;li&gt;&lt;a href=&quot;&#39; . $permalink . &#39;&quot; title=&quot;&#39; . esc_attr( $post_title ) . &#39;&quot;&gt;&#39; . $post_title . &#39;&lt;/a&gt;&lt;/li&gt;&#39;;
        }
        $output .= &#39;&lt;/ul&gt;&#39;;
    } else {
        // If there are no posts, we should return something, too!
        $output .= &#39;&lt;p&gt;Sorry, this category has just one post and you just read it!&lt;/p&gt;&#39;;
    }
    // Let&#39;s close the &lt;div&gt; and return the $output:
    $output .= &#39;&lt;/div&gt;&#39;;
    return $output;
}
</pre>
<p>Once done, open your <em>single.php</em> file and call the function as shown below, where you'd like to display the related posts:</p>
<pre>
&lt;?php echo wptuts_more_from_cat( &#39;More From This Category:&#39; ); ?&gt;
</pre>
<p><strong><em>Thanks to <a href="http://wp.tutsplus.com/articles/tips-articles/quick-tip-after-the-content-more-from-this-category/">WP Tuts</a> for the cool tip!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/PSQLJCD5CYk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-automatically-insert-a-list-of-related-articles-below-the-post/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-automatically-insert-a-list-of-related-articles-below-the-post</feedburner:origLink></item>
		<item>
		<title>How to add nofollow attributes to all links in a specific category</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/li9E5gSdHXY/how-to-add-nofollow-attributes-to-all-links-in-a-specific-category</link>
		<comments>http://www.wprecipes.com/how-to-add-nofollow-attributes-to-all-links-in-a-specific-category#comments</comments>
		<pubDate>Tue, 21 May 2013 15:55:08 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[link]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3575</guid>
		<description><![CDATA[Sometimes you may want to have an entire category of your blog with nofollow links, for exemple if you're linking to a lot of external resources. Here is a quick and easy recipe to do so. Enjoy!]]></description>
				<content:encoded><![CDATA[<p>Simply copy the code below and paste it on your <em>functions.php</em> file. Don't forget to set the desired category ID on line 3.</p>
<pre>
function nofollow_cat_posts($text) {
global $post;
        if( in_category(1) ) { // SET CATEGORY ID HERE
                $text = stripslashes(wp_rel_nofollow($text));
        }
        return $text;
}
add_filter('the_content', 'nofollow_cat_posts');
</pre>
<p><strong><em>Thanks to <a href="http://www.sagive.co.il">Sagive</a> for submitting this function!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/li9E5gSdHXY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-add-nofollow-attributes-to-all-links-in-a-specific-category/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-add-nofollow-attributes-to-all-links-in-a-specific-category</feedburner:origLink></item>
		<item>
		<title>Automatically spam comments with a very long url</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/av8OJnunrnI/automatically-spam-comments-with-a-very-long-url</link>
		<comments>http://www.wprecipes.com/automatically-spam-comments-with-a-very-long-url#comments</comments>
		<pubDate>Tue, 14 May 2013 16:21:54 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3554</guid>
		<description><![CDATA[Spam is definitely a problem for bloggers and most of you probably receive more than 100 spam comments per hour. Here is a simple recipe to automatically mark as spam all comments with an url longer than 50 characters. ]]></description>
				<content:encoded><![CDATA[<p>Open your functions.php file and paste the code below in it. This code will automatically mark as spam all comments with an url longer than 50 chars. This can be changed on line 4.</p>
<pre>
&lt;?php

  function rkv_url_spamcheck( $approved , $commentdata ) {
    return ( strlen( $commentdata[&#39;comment_author_url&#39;] ) &gt; 50 ) ? &#39;spam&#39; : $approved;
  }

  add_filter( &#39;pre_comment_approved&#39;, &#39;rkv_url_spamcheck&#39;, 99, 2 );

?&gt;
</pre>
<p><strong><em>Thanks to <a href="http://css-tricks.com/snippets/wordpress/spam-comments-with-very-long-urls/?utm_source=dlvr.it&#038;utm_medium=twitter">CSS Tricks</a> for the code snippet!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/av8OJnunrnI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/automatically-spam-comments-with-a-very-long-url/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/automatically-spam-comments-with-a-very-long-url</feedburner:origLink></item>
		<item>
		<title>Deal of the week: SpyBar (3 licences to win!!)</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/gRydv2JERIc/deal-of-the-week-spybar-3-licences-to-win</link>
		<comments>http://www.wprecipes.com/deal-of-the-week-spybar-3-licences-to-win#comments</comments>
		<pubDate>Fri, 03 May 2013 13:01:51 +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=3559</guid>
		<description><![CDATA[Today, I'm glad to introduce a new giveaway on WPRecipes, sponsored by our partners <a href="http://www.mightydeals.com/deal/spybar.html?ref=wprecipesspybar">Mighty Deals</a>. At the same time, I'm going to introduce SpyBar, an amazing tool for bloggers and website owners. ]]></description>
				<content:encoded><![CDATA[<h2>A word about Spybar</h2>
<p>The Internet is one huge swap meet. So many sites "borrow" code or plugins from other sites to make their own that much better. And then someone else borrows from their site, and so on. Keeping up with the latest and greatest Web features is an exhausting experience, though. You can check out tons of forums, blogs, newsletters and more just to read up on the latest releases. You can also pay a ton of money to various online services to pull in stats and suggestions.</p>
<p>The best way, though? Just browse. Check out what your competition's doing. If you find something you like, copy it. If only it were that easy to look beneath the hood. Well, it is. Thanks to <a href="http://www.mightydeals.com/deal/spybar.html?ref=wprecipesspybar">SpyBar</a>, you can pull in tons of useful data about any site, and you can do it all right from your Firefox or Chrome browser!</p>
<p>SpyBar is sold for only $7 for a limited time by <a href="http://www.mightydeals.com/deal/spybar.html?ref=wprecipesspybar">Mighty Deals</a>.</p>
<p>Here is a video demo of Spybar in action:<br />
<iframe frameborder="0" src="http://www.youtube.com/embed/i4KdQGFcyFo?vq=hd720&amp;rel=0" height="366" width="620"></iframe></p>
<h2>How to win a free Spybar licence!</h2>
<p>Our partners from <a href="http://www.mightydeals.com/deal/spybar.html?ref=wprecipesspybar">Mighty Deals</a> are happy to give away 3 Spybar licences to WPRecipes readers. To enter the contest, simply leave a comment to this post to let me know you'd like to win a free Spybar licence. I'll randomly pick 3 lucky winners on sunday using random.org. Winners will receive their prize directly in their email.</p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/gRydv2JERIc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/deal-of-the-week-spybar-3-licences-to-win/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/deal-of-the-week-spybar-3-licences-to-win</feedburner:origLink></item>
		<item>
		<title>How to make translatable JavaScript strings on your WordPress theme</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/2o_DMkgmt2Y/how-to-make-translatable-javascript-strings-on-your-wordpress-theme</link>
		<comments>http://www.wprecipes.com/how-to-make-translatable-javascript-strings-on-your-wordpress-theme#comments</comments>
		<pubDate>Mon, 29 Apr 2013 20:17:46 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3485</guid>
		<description><![CDATA[Do you know that WordPress have a function called wp_localize_script(), which allow you to localize JavaScript strings? Here's a practical example on how to use this little known but very useful function. ]]></description>
				<content:encoded><![CDATA[<p>Simply paste the following code into your function.php file, where you generally enqueue scripts and styles. Line 4 shows how to use the <em>wp_localize_script()</em> function.</p>
<pre>
function prefix_enqueue_custom_script(){
	wp_register_script( &#39;prefix_custom_script&#39;, plugin_dir_url( __FILE__ ) .&#39;js/custom-script.js&#39;, array( &#39;jquery&#39; ) );
        wp_enqueue_script( &#39;prefix_custom_script&#39; );
        wp_localize_script( &#39;prefix_custom_script&#39;, &#39;prefix_object_name&#39;, array(
		&#39;upload&#39; =&gt; __( &#39;upload&#39;, &#39;textdomain&#39; ),
		&#39;remove&#39; =&gt; __( &#39;remove&#39;, &#39;textdomain&#39; )
	) );
}
</pre>
<p><strong><em>Thanks to <a href="http://wptheming.com/2013/01/translatable-javascript-strings-in-wordpress/">Devin</a> for this code!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/2o_DMkgmt2Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-make-translatable-javascript-strings-on-your-wordpress-theme/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-make-translatable-javascript-strings-on-your-wordpress-theme</feedburner:origLink></item>
		<item>
		<title>How to add SVG upload support to your WordPress blog</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/A1Z_CemYntA/how-to-add-svg-upload-support-to-your-wordpress-blog</link>
		<comments>http://www.wprecipes.com/how-to-add-svg-upload-support-to-your-wordpress-blog#comments</comments>
		<pubDate>Thu, 25 Apr 2013 14:21:43 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3545</guid>
		<description><![CDATA[By default, WordPress uploader do not support the SVG format. As this file format is becoming quite popular theses days, here is a simple recipe to add SVG upload to your WordPress install. ]]></description>
				<content:encoded><![CDATA[<p>Simply add the code below to <em>functions.php</em> in your WordPress theme. SVG upload will be supported once the file is saved.</p>
<pre>
add_filter(&#39;upload_mimes&#39;, &#39;my_upload_mimes&#39;);
 
function my_upload_mimes($mimes = array()) {
    $mimes[&#39;svg&#39;] = &#39;image/svg+xml&#39;;
    return $mimes;
}
</pre>
<p><strong><em>Thanks to <a href="https://gist.github.com/dbushell/4247060">dbushell</a> for the snippet!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/A1Z_CemYntA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-add-svg-upload-support-to-your-wordpress-blog/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-add-svg-upload-support-to-your-wordpress-blog</feedburner:origLink></item>
		<item>
		<title>How to create a directory within the uploads folder</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/dxRW3aFgg50/how-to-create-a-directory-within-the-uploads-folder</link>
		<comments>http://www.wprecipes.com/how-to-create-a-directory-within-the-uploads-folder#comments</comments>
		<pubDate>Tue, 23 Apr 2013 16:23:24 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[content]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=3542</guid>
		<description><![CDATA[When developing a plugin or theme, it can be useful to be able to programmatically create a directory within the wp-content/uploads folder. Here is a handy piece of code to do it.]]></description>
				<content:encoded><![CDATA[<p>Simply paste this code snippet on your <em>functions.php</em> file (or plugin file if you're creating a plugin) </p>
<pre>
function myplugin_activate() {
    
    $upload = wp_upload_dir();
    $upload_dir = $upload[&#39;basedir&#39;];
    $upload_dir = $upload_dir . &#39;/mypluginfiles&#39;;
    if (! is_dir($upload_dir)) {
       mkdir( $upload_dir, 0700 );
    }
}
 
register_activation_hook( __FILE__, &#39;myplugin_activate&#39; );
</pre>
<p><strong><em>Thanks to <a href="http://www.wpmayor.com/code/code-snippet-to-create-a-directory-within-uploads-folder/">Jean Galea</a> for the snippet!</em></strong></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/dxRW3aFgg50" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-create-a-directory-within-the-uploads-folder/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-create-a-directory-within-the-uploads-folder</feedburner:origLink></item>
	</channel>
</rss>
