Skip to content

Instantly share code, notes, and snippets.

@thecodepoetry
Created February 4, 2020 07:25
Show Gist options
  • Save thecodepoetry/6a71e75e30b553d9444bf9deec44cdff to your computer and use it in GitHub Desktop.
Save thecodepoetry/6a71e75e30b553d9444bf9deec44cdff to your computer and use it in GitHub Desktop.
Add new share buttons
function new_share_email($share_buttons, $place, $post_id, $buttons){
$url = get_permalink( $post_id );
$title = isset( $_post->post_title ) ? $_post->post_title : '';
$share_buttons[] = array(
'id' => 'email' ,
'url' => 'mailto:?subject=I wanted you to see this site&body=' . $title . ' ' . $url,
'name' => 'Email',
'title' => 'Share on Facebook',
'alt_title' => 'Share on Facebook',
'icon_class' => 'email' ,
'custom_atts' => '',
);
return $share_buttons;
}
add_filter("the7_get_share_buttons_list", "new_share_email", 10, 4);
@thecodepoetry
Copy link
Author

Then you will have to add necessary CSS to style the button, it will be something like this

.single-share-box .share-buttons a.email{
color: #9d9d9d;
transition: 150ms all ease-in-out;
&:hover {
color: #474747;
}
&:before {
content: "\e001";
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment