WordPress tip: Send article to a friend by email

November 13, 2009 at 8:59 am

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.

To apply this recipe to your blog, simply paste the following function into your functions.php file, and that’s all. Hard to do something simpler!

function direct_email($text="Send by email"){
        global $post;
        $title = htmlspecialchars($post->post_title);
        $subject = 'Sur '.htmlspecialchars(get_bloginfo('name')).' : '.$title;
        $body = 'I recommend this page : '.$title.'. You can read it on : '.get_permalink($post->ID);
        $link = '<a rel="nofollow" href="mailto:?subject='.rawurlencode($subject).'&amp;body='.rawurlencode($body).'" title="'.$text.' : '.$title.'">'.$text.'</a>';
        return $link;
}

Thanks to : WebInventif.fr for the awesome trick!

Also, I got some exiting news for you : First, Chris Coyier and Jeff Starr just released their first ebook, called “Dig into WordPress“. I recommend you to have a look at it!

Second, I have some great WordPress related domain names for sale:
wpdoc.com : 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.

wpplr.com : Stands for WordPress Private Label Right. Wonderful opportunity if you’re looking to create and release PLR WordPress themes! Price is only $15!

wp3k.com : Stands for WordPress 3000. I only ask $15 for this 4 characters domain.

If you want one of them, simply send me an email. First come, first served, so be quick!

Tags: