Want to Write for Us?Read This | LoginBecome a Member

Adding ‘Email Post’ Without a Plugin

emailthisAnd yet another great and simple hack that will make you smile!

This is how I create the simple “Email Post” functionality on every single post dynamically without a plugin.

Super easy and super effective!

My reason behind this was simple: More than a few people have told me they’ve emailed the post to friends, staff, and others and I thought that in my redesign I should make it even easier for them.

What it does is simply boot up the user’s email client (like Apple Mail) and auto populate the Subject: and also provides the link in the body.

Superb!

emailthispost

Here’s my code:

<a href="mailto:?subject=<?php the_title(); ?> - From ChurchCrunch.com&body=<?php the_permalink() ?>" title="Email this Post to a Friend!">Email Post</a>
<a title="Email this Post to a Friend!" href="mailto:?subject=&lt;?php the_title(); ?&gt; - From ChurchCrunch.com&amp;body=&lt;?php the_permalink() ?&gt;">
</a>

10 Responses to “Adding ‘Email Post’ Without a Plugin”

  1. April 23, 2009 at #

    Thanks so much for sharing these pieces of code with us! By sharing your expertise in this area, you are allowing us to all do things better!

  2. April 23, 2009 at #

    Are you literally putting them in the post html on every post or building it in so it is in every post?

    • April 23, 2009 at #

      every post. single.php in the loop.

      • April 23, 2009 at #

        You win. I think today is the day I actually figure out how my blog works. Here goes nothing.

        • April 23, 2009 at #

          And I broke it… but then I fixed it! This coding stuff is easy! errr….

  3. Rich Schmidt
    April 23, 2009 at #

    Thanks, John! I'd already swiped your code after you pointed out your method for creating the Tweet this link. :) Works like a charm!

  4. Jim
    April 23, 2009 at #

    bahahaha~

  5. April 24, 2009 at #

    Thanks, John, for sharing your code. As I'm building my site it helps to see how the good ones code theirs! ;)

  6. April 25, 2009 at #

    it's not working right with my code. Can you give me some HTML/php help. I want it on the left side on the same line as the comments and catagories. It's not going there tough.

Trackbacks/Pingbacks:

  1. Blogging Tips: SOB's Top 5 Wordpress Plug-in Alternatives: Reduce Server Load & Site Loading Time by Strictly Online Biz Inc. - July 9, 2009

    [...] Post</a>. Do remember to change From ChurchCrunch.com to your own site. Thanks to Church Crunch for this tip.Tweet This Plug-in Alternative: Simply add this code <a rel=”nofollow” [...]

Leave a Reply

Gravatar Image