-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathframepress-social.php
32 lines (28 loc) · 1.8 KB
/
framepress-social.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/*
Plugin Name: Framepress SocialSharing
Plugin URI: https://solutions.io/
Description: Display social sharing icons after activation, no setup needed. Works for Twitter, Facebook, Google+, Linkedin and Xing.
Author: solutions.io
Version: 1.1
Author URI: https://solutions.io
*/
add_action( 'wp_footer', 'framepress_socialshare' );
function framepress_socialshare() { ?>
<div class="social-shares hidden-xs">
<a target="_blank" href="https://twitter.com/intent/tweet?text=<?php the_title(); ?>&url=<?php the_permalink(); ?>"><p class="btn-twitter"><i class="fa fa-twitter"></i></p></a>
<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><p class="btn-facebook"><i class="fa fa-facebook"></i></p></a>
<a target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"><p class="btn-gplus"><i class="fa fa-google-plus"></i></p></a>
<a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&source=<?php the_permalink(); ?>"><p class="btn-linkedin"><i class="fa fa-linkedin"></i></p></a>
<a target="_blank" href="https://www.xing-share.com/app/user?op=share;sc_p=xing-share;url=<?php the_permalink(); ?>"><p class="btn-xing"><i class="fa fa-xing"></i></p></a>
</div>
<?php }
function framepress_socialshare_style() {
$plugin_url = plugin_dir_url( __FILE__ );
wp_enqueue_style( 'framepress_socialshare_style', $plugin_url . 'assets/css/style.css' );
if (!wp_style_is( 'fontawesome', 'enqueued' )) {
wp_register_style( 'fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', false, '4.7.0' );
wp_enqueue_style( 'fontawesome' );
}
add_action( 'wp_enqueue_scripts', 'framepress_socialshare_style' );
?>