Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add Email This Option to Bottom of Post
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Email This Option to Bottom of Post
add_filter( 'the_content', 'wps_add_email_this_button' );
function wps_add_email_this_button($content){
if (is_single()) {
$content .= '<a class="mail-btn" href="mailto:?subject=' . get_the_title() . '&amp;body=' . get_the_permalink() . '" title="Send this article to a friend!">Email this</a>';
}
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.