<?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>Mon, 23 Nov 2009 07:10:11 +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" href="http://feeds.feedburner.com/Wprecipes" type="application/rss+xml" /><feedburner:emailServiceId>Wprecipes</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>WordPress 2.9 : Display post image with backward compatibility</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/S0EdwrnROiU/wordpress-2-9-display-post-image-with-backward-compatibility</link>
		<comments>http://www.wprecipes.com/wordpress-2-9-display-post-image-with-backward-compatibility#comments</comments>
		<pubDate>Mon, 23 Nov 2009 07:10:11 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[custom field]]></category>
		<category><![CDATA[wordpress 2.9]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2206</guid>
		<description><![CDATA[In a few days, WordPress 2.9 will be released. This all new version feature a bunch of interesting functions to display an image attached to a post. <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-2-9-display-post-image-with-backward-compatibility">WordPress 2.9 : Display post image with backward compatibility</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Paste the following code, within the loop,  where you want to post image to be displayed.
<pre>
&lt;?php
	if (  (function_exists('has_post_image')) &#038;& (has_post_image())  ) {
		the_post_image('thumbnail');
	} else {
		$postimageurl = get_post_meta($post-&gt;ID, 'post-image', true);
		if ($postimageurl) {
			echo '&lt;img src=&quot;'.$postimageurl.'&quot; alt=&quot;&quot; /&gt;';
		}
	}
?&gt;
</pre>
<p>What this code do :<br />
-First, it makes sure that the <em>has_post_image()</em> function exists and that the current post have an image attached. If both conditions are true, the post image is displayed using WordPress 2.9 function <em>the_post_image()</em>.<br />
-If not, the <em>get_post_meta()</em> function is used to get the value of the custom field which contain the post image.</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-2-9-display-post-image-with-backward-compatibility">WordPress 2.9 : Display post image with backward compatibility</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/S0EdwrnROiU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-2-9-display-post-image-with-backward-compatibility/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-2-9-display-post-image-with-backward-compatibility</feedburner:origLink></item>
		<item>
		<title>WordPress hack : Automatically output the content in two columns</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/8MufVmcqO3c/wordpress-hack-automatically-output-the-content-in-two-columns</link>
		<comments>http://www.wprecipes.com/wordpress-hack-automatically-output-the-content-in-two-columns#comments</comments>
		<pubDate>Wed, 18 Nov 2009 07:34:19 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[the_content]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2198</guid>
		<description><![CDATA[Printed magazines often display text in columns, so why blogs shouldn't be able to do the same? Juste read on to find out how to easily and automatically display your post content in columns.<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-automatically-output-the-content-in-two-columns">WordPress hack : Automatically output the content in two columns</a></p>
]]></description>
			<content:encoded><![CDATA[<p>This code is poweful but definitely easy to implement. Just paste it on your <em>functions.php</em> file and it will automatically output your post content in columns.<br />
Your post content will be splitted on <em>&lt;h2></em> tags.</p>
<pre>
function my_multi_col($content){
$columns = explode('&lt;h2&gt;', $content);

$i = 0;

	foreach ($columns as $column){
	if (($i % 2) == 0){
		$return .= '&lt;div class=&quot;content_left&quot;&gt;' . &quot;\n&quot;;
		if ($i &gt; 1){
		$return .= &quot;&lt;h2&gt;&quot;;
	} else{
		$return .= '&lt;div class=&quot;content_right&quot;&gt;' . &quot;\n &lt;h2&gt;&quot;;
	}
		$return .= $column;
		$return .= '&lt;/p&gt;&lt;/div&gt;';
		$i++;
	}

	if(isset($columns[1])){
	    $content = wpautop($return);
	}else{
	    $content = wpautop($content);
	}
	echo $content;
}
}
add_filter('the_content', 'my_multi_col');
</pre>
<p>Don't forget to add the following styles to your <em>style.css</em> file :</p>
<pre>
.content_right, .content_left{
    float:left;
    width:45%;
}

.content_left{
    padding-right:5%;
}
</pre>
<p><strong><em>Thanks to <a href="http://www.kriesi.at/archives/wordpress-display-content-in-multiple-columns">www.kriesi.at</a> for contributing this great function to the community!</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-automatically-output-the-content-in-two-columns">WordPress hack : Automatically output the content in two columns</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/8MufVmcqO3c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-hack-automatically-output-the-content-in-two-columns/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-hack-automatically-output-the-content-in-two-columns</feedburner:origLink></item>
		<item>
		<title>Display the number of tweets for each page or post</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/HJfWWM2bZWY/display-the-number-of-tweets-for-each-page-or-post</link>
		<comments>http://www.wprecipes.com/display-the-number-of-tweets-for-each-page-or-post#comments</comments>
		<pubDate>Mon, 16 Nov 2009 07:08:18 +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=2187</guid>
		<description><![CDATA[Twitter is a very cool tool, especially if you're a blogger. Using some php it is easy to display how many times a specific blog post has been tweeted. This is what you're going to learn in 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/display-the-number-of-tweets-for-each-page-or-post">Display the number of tweets for each page or post</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To apply this hack, you have to make sure that the SimpleXML PHP extension is loaded. If you're using <a href="http://www.catswhocode.com/blog/wpwebhost.html">WpWebHost</a> or <a href="http://www.catswhocode.com/blog/hostgator.html">HostGator</a>, it is.</p>
<p>The first step is to place the following piece of code in your <em>functions.php</em> file:</p>
<pre>
function tweetCount($url) {
	$content = file_get_contents("http://api.tweetmeme.com/url_info?url=".$url);
	$element = new SimpleXmlElement($content);
	$tweets = $element-&gt;story-&gt;url_count;
 	echo $tweets." tweets!";
}
</pre>
<p>Once done, open your <em>single.php</em> file and call the function like this:</p>
<pre>&lt;?php tweetCount($post->permalink); ?&gt;</pre>
<p>Nice, isn't it?</p>
<p><strong><em>Credits goes to <a href="http://perishablepress.com/press/2009/10/18/stupid-twitter-tricks/">Jeff Starr</a> for this nice trick!</em></strong></p>
<p>For those who have missed my great domain name deal from friday, don't worry, I got a plenty of them for sale at very good price, including facebook-developer.com, webdev.fr, etc. Just click <a href="http://www.catswhoblog.com/domains-for-sale">here</a> to visit my domain name portfolio.</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-the-number-of-tweets-for-each-page-or-post">Display the number of tweets for each page or post</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/HJfWWM2bZWY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/display-the-number-of-tweets-for-each-page-or-post/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/display-the-number-of-tweets-for-each-page-or-post</feedburner:origLink></item>
		<item>
		<title>WordPress tip: Send article to a friend by email</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/l5mF1UqMUi8/wordpress-tip-send-article-to-a-friend-by-email</link>
		<comments>http://www.wprecipes.com/wordpress-tip-send-article-to-a-friend-by-email#comments</comments>
		<pubDate>Fri, 13 Nov 2009 06:59:51 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2157</guid>
		<description><![CDATA[In order to create more traffic on your blog, it can be a good idea to let your readers send your posts to their friends by email. A few month ago, I already shown you a function to do that, here is an improved version for today.<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-send-article-to-a-friend-by-email">WordPress tip: Send article to a friend by email</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To apply this recipe to your blog, simply paste the following function into your <em>functions.php</em> file, and that's all. Hard to do something simpler!</p>
<pre>
function direct_email($text=&quot;Send by email&quot;){
        global $post;
        $title = htmlspecialchars($post-&gt;post_title);
        $subject = 'Sur '.htmlspecialchars(get_bloginfo('name')).' : '.$title;
        $body = 'I recommend this page : '.$title.'. You can read it on : '.get_permalink($post-&gt;ID);
        $link = '&lt;a rel=&quot;nofollow&quot; href=&quot;mailto:?subject='.rawurlencode($subject).'&amp;amp;body='.rawurlencode($body).'&quot; title=&quot;'.$text.' : '.$title.'&quot;&gt;'.$text.'&lt;/a&gt;';
        return $link;
}
</pre>
<p><strong><em>Thanks to : <a href="http://www.webinventif.fr/wordpress-lien-envoyer-page-mail/" target="blank">WebInventif.fr</a> for the awesome trick!</em></strong></p>
<p>Also, I got some exiting news for you : First, Chris Coyier and Jeff Starr just released their first ebook, called "<a href="http://www.catswhocode.com/blog/diw.html">Dig into WordPress</a>". I recommend you to have a look at it!</p>
<p><strong>Second, I have some great WordPress related domain names for sale: </strong><br />
<strong>wpdoc.com</strong> : Stands for both "WordPress Doctor" or "WordPress Documentation". DEFINITELY a great opportunity if you're looking to start your own WOrdPress related site or business. Price is $25.</p>
<p><strong>wpplr.com</strong> : Stands for WordPress Private Label Right. Wonderful opportunity if you're looking to create and release PLR WordPress themes! Price is only $15!</p>
<p><strong>wp3k.com</strong> : Stands for WordPress 3000. I only ask $15 for this 4 characters domain.</p>
<p>If you want one of them, simply <a href="http://www.wprecipes.com/contact">send me an email</a>. First come, first served, so be quick!</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-send-article-to-a-friend-by-email">WordPress tip: Send article to a friend by email</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/l5mF1UqMUi8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-tip-send-article-to-a-friend-by-email/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-tip-send-article-to-a-friend-by-email</feedburner:origLink></item>
		<item>
		<title>Rewrite author name with custom field</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/AY_sWhapDV0/rewrite-author-name-with-custom-field</link>
		<comments>http://www.wprecipes.com/rewrite-author-name-with-custom-field#comments</comments>
		<pubDate>Mon, 09 Nov 2009 07:37:20 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[page template]]></category>
		<category><![CDATA[templ]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2158</guid>
		<description><![CDATA[In my other blog <a href="http://www.catswhoblog.com">Cats Who Blog</a>, I have demonstrated how being a guest blogger is definitely a great way to gain new readers. In order to give your guest authors some credits, you should definitely implement this easy tip.<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/rewrite-author-name-with-custom-field">Rewrite author name with custom field</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Nothing hard with this recipe: Simply paste the following code on your <em>single.php</em> and <em>page.php</em>, where you want the author name to be displayed.</p>
<pre>
&lt;?php $author = get_post_meta($post-&gt;ID, &quot;guest-author&quot;, true);
if ($author != &quot;&quot;) {
    echo $author;
} else {
    the_author();
}  ?>
</pre>
<p>Once done, you just have to create a custom field named <em>guest-author</em> and type your custom title as a value.</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/rewrite-author-name-with-custom-field">Rewrite author name with custom field</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/AY_sWhapDV0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/rewrite-author-name-with-custom-field/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/rewrite-author-name-with-custom-field</feedburner:origLink></item>
		<item>
		<title>How to show WordPress post attachments</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/3-nL_b7SSng/how-to-show-wordpress-post-attachments</link>
		<comments>http://www.wprecipes.com/how-to-show-wordpress-post-attachments#comments</comments>
		<pubDate>Fri, 06 Nov 2009 07:04:21 +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=2162</guid>
		<description><![CDATA[Since WordPress 2.5, attachments management in WordPress have been improved and is now very powerful. Today, I'm going to show you a simple code snippet that you can use in your WordPress theme to display post attachments.<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-show-wordpress-post-attachments">How to show WordPress post attachments</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To achieve this recipe, just paste the following code anywhere in your <em>post.php</em> file and attachments will be displayed.</p>
<pre>
$args = array(
	'post_type' => 'attachment',
	'numberposts' => null,
	'post_status' => null,
	'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
	foreach ($attachments as $attachment) {
		echo apply_filters('the_title', $attachment->post_title);
		the_attachment_link($attachment->ID, false);
	}
}
</pre>
<p><strong><em>Credit : <a href="http://snipplr.com/view.php?codeview&#038;id=5375">Snipplr</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-show-wordpress-post-attachments">How to show WordPress post attachments</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/3-nL_b7SSng" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-show-wordpress-post-attachments/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-show-wordpress-post-attachments</feedburner:origLink></item>
		<item>
		<title>Display all thumbs related to a specific page on a media page in WordPress</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/piZiKJ05W6U/display-all-thumbs-related-to-a-specific-page-on-a-media-page-in-wordpress</link>
		<comments>http://www.wprecipes.com/display-all-thumbs-related-to-a-specific-page-on-a-media-page-in-wordpress#comments</comments>
		<pubDate>Wed, 04 Nov 2009 07:59:18 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2147</guid>
		<description><![CDATA[Today, here is a nice piece of code to display all thumbs related to a specific page on a media pages. Very nice for galleries!<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-all-thumbs-related-to-a-specific-page-on-a-media-page-in-wordpress">Display all thumbs related to a specific page on a media page in WordPress</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Simply paste the following function into your <em>functions.php</em> file:
<pre>
function wallthumb($id=false,$beforelist='&lt;ul class=&quot;gallerythumb&quot;&gt;',$afterlist='&lt;/ul&gt;',$beforeitem='&lt;li&gt;',$afteritem='&lt;/li&gt;'){
        global $wp_query;
        $goquery = $wp_query-&gt;post;//contenu de la requ&#232;te
        if(is_attachment()){
                $ptitre = $goquery-&gt;post_title;//le titre de l'image
                $idparent = $goquery-&gt;post_parent;//l'id de la page parente
                if(!$id){//si pas d'id en argument, on tente de la recuperer
                        $id = $goquery-&gt;ID;
                }
                if($idparent == null || $idparent == '' || $idparent == 0){
                        return;//si l'image est orpheline (sans page parente) on stop la fonction
                }
                //$twice = get_posts('post_type=attachment&amp;post_mime_type=image&amp;numberposts=-1&amp;order=ASC&amp;post_status=null&amp;post_parent='.$idparent);//recup des infos des pi&#232;ces jointes a la page parente
                $twice = get_children('post_type=attachment&amp;post_mime_type=image&amp;order=ASC&amp;post_parent='.$idparent);//recup des infos des pi&#232;ces jointes a la page parente
                $stocklienimage = array();//pour stocker les liens images
                if($twice){//si pi&#232;ces jointes
                        foreach ($twice as $value) {//boucle
                                $classthumbactu = '';
                                if($value-&gt;ID == $id){//detection de l'image courante dans la boucle pour ajout d'une classe pour la differencier
                                        $classthumbactu=' thumbactu';
                                }
                                $stocklienimage[$value-&gt;ID] = $beforeitem.'&lt;a class=&quot;wallthumb'.$classthumbactu.'&quot; href=&quot;'.get_attachment_link($value-&gt;ID).'&quot; title=&quot;'.wp_specialchars( get_the_title($value-&gt;ID), 1 ).'&quot; rel=&quot;attachment&quot;&gt;'.wp_get_attachment_image( $value-&gt;ID, 'thumbnail' ).'&lt;/a&gt;'.$afteritem;
                        }
                }else{
                        return;
                }
                echo $beforelist.implode('', $stocklienimage).$afterlist;//affichage de la liste
        }
}</pre>
<p>Once done, you just have to call the function:</p>
<pre>&lt;?php wallthumb() ?&gt;</pre>
<p>Enjoy your gallery! Note that another version of the same code is available <a href="http://pioupioum.fr/outils-astuces/afficher-images-article-page-media.html">here</a>.</p>
<p><strong><em>Thanks to <a href="http://www.webinventif.fr/wordpress-afficher-toutes-miniatures-liees-article-pages-media/">Julien Chauvin</a> for this great 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/display-all-thumbs-related-to-a-specific-page-on-a-media-page-in-wordpress">Display all thumbs related to a specific page on a media page in WordPress</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/piZiKJ05W6U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/display-all-thumbs-related-to-a-specific-page-on-a-media-page-in-wordpress/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/display-all-thumbs-related-to-a-specific-page-on-a-media-page-in-wordpress</feedburner:origLink></item>
		<item>
		<title>WordPress hack: Extend the body_class function</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/qxqvFMyGoVE/wordpress-hack-extend-the-body_class-function</link>
		<comments>http://www.wprecipes.com/wordpress-hack-extend-the-body_class-function#comments</comments>
		<pubDate>Mon, 02 Nov 2009 07:07:24 +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=2140</guid>
		<description><![CDATA[Introduced in WordPress 2.7 the body_class() function is extremely useful to style a particular post, page or subpage. But when we look at the subsubpages, the parent page ID is that of it’s nearest parent and not the ID of it’s top level parent. Let's solve this issue.<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-extend-the-body_class-function">WordPress hack: Extend the body_class function</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Nothing hard at all. Paste the following code in your <em>function.php</em> file :
<pre>
add_filter('body_class','top_level_parent_id_body_class');
function top_level_parent_id_body_class($classes) {
	global $wpdb, $post;
	if (is_page()) {
	    if ($post-&gt;post_parent)	{
        	$ancestors=get_post_ancestors($post-&gt;ID);
        	$root=count($ancestors)-1;
        	$parent = $ancestors[$root];
        } else {
        	$parent = $post-&gt;ID;
        }
        $classes[] = 'top-level-parent-pageid-' . $parent;
	}
	return $classes;
}
</pre>
<p>Once your <em>functions.php</em> file is saved, you're done. </p>
<p><strong><em>Thanks to <a href="http://blog.mrhenry.be/2009/10/extending-the-wordpress-body_class-function-with-the-top-level-parent-id/">Mr Henry</a> for this very cool recipe!</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-extend-the-body_class-function">WordPress hack: Extend the body_class function</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/qxqvFMyGoVE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-hack-extend-the-body_class-function/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-hack-extend-the-body_class-function</feedburner:origLink></item>
		<item>
		<title>How to: Show parent page title regardless of what subpage you are on</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/8fDraagGLzY/how-to-show-parent-page-title-regardless-of-what-subpage-you-are-on</link>
		<comments>http://www.wprecipes.com/how-to-show-parent-page-title-regardless-of-what-subpage-you-are-on#comments</comments>
		<pubDate>Fri, 30 Oct 2009 07:47:27 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[page]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2133</guid>
		<description><![CDATA[Althougt it may sound simple to advanced WordPress coders, I had many requests from people working with WordPress as a CMS and wanting to be easily able to display parent page title on a subpage.<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-show-parent-page-title-regardless-of-what-subpage-you-are-on">How to: Show parent page title regardless of what subpage you are on</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Nothing hard at all: Just paste the following code where you'd like to display the parent page title:</p>
<pre>
&lt;?php
if($post-&gt;post_parent) {
    $parent_title = get_the_title($post-&gt;post_parent);
    echo $parent_title;
} else {
    wp_title('');
}
?&gt;
</pre>
<p>That's all! Quick and easy, as we like <img src='http://www.wprecipes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><em>This recipe has been submitted by <a href="http://www.wesbos.com">Wes Bos</a>. Have WordPress skills? Feel free to <a href="http://www.wprecipes.com/contribute">contribute</a> to WpRecipes!</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-show-parent-page-title-regardless-of-what-subpage-you-are-on">How to: Show parent page title regardless of what subpage you are on</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/8fDraagGLzY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/how-to-show-parent-page-title-regardless-of-what-subpage-you-are-on/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/how-to-show-parent-page-title-regardless-of-what-subpage-you-are-on</feedburner:origLink></item>
		<item>
		<title>WordPress upgrade : Allow more time for slow servers</title>
		<link>http://feedproxy.google.com/~r/Wprecipes/~3/YkuwjuDctp0/wordpress-upgrade-allow-more-time-for-slow-servers</link>
		<comments>http://www.wprecipes.com/wordpress-upgrade-allow-more-time-for-slow-servers#comments</comments>
		<pubDate>Wed, 28 Oct 2009 07:32:32 +0000</pubDate>
		<dc:creator>Jean-Baptiste Jung</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.wprecipes.com/?p=2127</guid>
		<description><![CDATA[WordPress auto download/install is a very nice feature, but sometimes a few problems can appear. One of them is that WordPress don't manage to download the new version. This happens on slow servers. Here is how to solve 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-upgrade-allow-more-time-for-slow-servers">WordPress upgrade : Allow more time for slow servers</a></p>
]]></description>
			<content:encoded><![CDATA[<p>To apply this hack, you'll have to edit one of WordPress core files. Keep in mind that it is never recommended. This hack should be applied only if you have problems while auto-upgrading WordPress.</p>
<p>Open the <em>wp-admin/includes/files.php</em> file and go to line 448. You'll see the following:</p>
<pre>$response = wp_remote_get($url, array('timeout' => 60));</pre>
<p>To allow more downloading time, simply change the 60 with a greater value, as for example:</p>
<pre>$response = wp_remote_get($url, array('timeout' => 120));</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-upgrade-allow-more-time-for-slow-servers">WordPress upgrade : Allow more time for slow servers</a></p>
<img src="http://feeds.feedburner.com/~r/Wprecipes/~4/YkuwjuDctp0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wprecipes.com/wordpress-upgrade-allow-more-time-for-slow-servers/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://www.wprecipes.com/wordpress-upgrade-allow-more-time-for-slow-servers</feedburner:origLink></item>
	</channel>
</rss>
