-
Notifications
You must be signed in to change notification settings - Fork 1
/
share.php
39 lines (32 loc) · 1.45 KB
/
share.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
33
34
35
36
37
38
39
<div class="share-horizontal clearfix">
<?php
$id = get_the_ID();
$title = get_the_title();
// $url = stf_get_shortlink();
$url = get_permalink();
$tweet = stf_generate_post_tweet( $id );
$context = 'post';
if( is_page() ) $context = 'page';
if( is_attachment() ) $context = 'file';
if( get_post_format() == 'link' ) $context = 'link';
if( get_post_format() == 'gallery' ) $context = 'gallery';
if( get_post_format() == 'image' ) $context = 'image';
if( get_post_format() == 'quote' ) $context = 'quote';
if( get_post_format() == 'chat' ) $context = 'chat';
if( get_post_format() == 'video' ) $context = 'video';
if( get_post_format() == 'audio' ) $context = 'audio';
?>
<div class="share-label">Like this <?php echo $context; ?>?</div>
<div class="share-button tweet-button">
<!-- tweet -->
<a href="http://twitter.com/share" class="twitter-share-button tooltip" data-text="<?php echo $tweet ?>" data-count="horizontal" data-via="shailancom" title="Tweet this post!" >Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>
<div class="share-button plusone-button">
<!-- plusone -->
<g:plusone size="medium"></g:plusone>
</div>
<div class="share-button facebook-button">
<!-- facebook share -->
<fb:like href="<?php echo $url ?>" send="true" layout="button_count" width="120" show_faces="false" ></fb:like>
</div>
</div>